public static class NioEndpoint.NioSocketWrapper extends SocketWrapperBase<NioChannel>
SocketWrapperBase.BlockingMode, SocketWrapperBase.CompletionCheck, SocketWrapperBase.CompletionHandlerCall, SocketWrapperBase.CompletionState, SocketWrapperBase.OperationState<A>, SocketWrapperBase.VectoredIOCompletionHandler<A>bufferedWriteSize, closed, COMPLETE_READ, COMPLETE_READ_WITH_COMPLETION, COMPLETE_WRITE, COMPLETE_WRITE_WITH_COMPLETION, localAddr, localName, localPort, nonBlockingWriteBuffer, READ_DATA, readOperation, readPending, remoteAddr, remoteHost, remotePort, sm, socketBufferHandler, writeOperation, writePending| Constructor and Description |
|---|
NioSocketWrapper(NioChannel channel,
NioEndpoint endpoint) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
awaitLatch(java.util.concurrent.CountDownLatch latch,
long timeout,
java.util.concurrent.TimeUnit unit) |
void |
awaitReadLatch(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
awaitWriteLatch(long timeout,
java.util.concurrent.TimeUnit unit) |
SendfileDataBase |
createSendfileData(java.lang.String filename,
long pos,
long length) |
void |
doClientAuth(SSLSupport sslSupport)
Require the client to perform CLIENT-CERT authentication if it hasn't
already done so.
|
protected void |
doClose()
Perform the actual close.
|
protected void |
doWrite(boolean block,
java.nio.ByteBuffer from)
Write the contents of the ByteBuffer to the socket.
|
long |
getLastRead() |
long |
getLastWrite() |
NioEndpoint.Poller |
getPoller() |
java.util.concurrent.CountDownLatch |
getReadLatch() |
NioEndpoint.SendfileData |
getSendfileData() |
SSLSupport |
getSslSupport(java.lang.String clientCertProvider) |
java.util.concurrent.CountDownLatch |
getWriteLatch() |
int |
interestOps() |
int |
interestOps(int ops) |
boolean |
isReadyForRead() |
protected <A> SocketWrapperBase.OperationState<A> |
newOperationState(boolean read,
java.nio.ByteBuffer[] buffers,
int offset,
int length,
SocketWrapperBase.BlockingMode block,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
SocketWrapperBase.CompletionCheck check,
java.nio.channels.CompletionHandler<java.lang.Long,? super A> handler,
java.util.concurrent.Semaphore semaphore,
SocketWrapperBase.VectoredIOCompletionHandler<A> completion) |
protected void |
populateLocalAddr() |
protected void |
populateLocalName() |
protected void |
populateLocalPort() |
protected void |
populateRemoteAddr() |
protected void |
populateRemoteHost() |
protected void |
populateRemotePort() |
SendfileState |
processSendfile(SendfileDataBase sendfileData)
Starts the sendfile process.
|
int |
read(boolean block,
byte[] b,
int off,
int len) |
int |
read(boolean block,
java.nio.ByteBuffer to) |
void |
registerReadInterest() |
void |
registerWriteInterest() |
protected java.util.concurrent.CountDownLatch |
resetLatch(java.util.concurrent.CountDownLatch latch) |
void |
resetReadLatch() |
void |
resetWriteLatch() |
void |
setAppReadBufHandler(ApplicationBufferHandler handler) |
void |
setSendfileData(NioEndpoint.SendfileData sf) |
protected java.util.concurrent.CountDownLatch |
startLatch(java.util.concurrent.CountDownLatch latch,
int cnt) |
void |
startReadLatch(int cnt) |
void |
startWriteLatch(int cnt) |
void |
updateLastRead() |
void |
updateLastWrite() |
awaitReadComplete, awaitWriteComplete, canWrite, checkError, close, decrementKeepAlive, doWrite, execute, flush, flushBlocking, flushNonBlocking, getBlockingStatus, getBlockingStatusReadLock, getBlockingStatusWriteLock, getEndpoint, getError, getLocalAddr, getLocalName, getLocalPort, getNegotiatedProtocol, getReadTimeout, getRemoteAddr, getRemoteHost, getRemotePort, getSocket, getSocketBufferHandler, getWriteTimeout, hasAsyncIO, hasDataToRead, hasDataToWrite, hasPerOperationTimeout, isClosed, isReadPending, isReadyForWrite, isSecure, isUpgraded, isWritePending, needSemaphores, populateReadBuffer, populateReadBuffer, processSocket, read, read, read, reset, setBlockingStatus, setError, setKeepAliveLeft, setNegotiatedProtocol, setReadTimeout, setSecure, setUpgraded, setWriteTimeout, toString, transfer, transfer, unRead, vectoredOperation, write, write, write, write, write, writeBlocking, writeBlocking, writeBlockingDirect, writeNonBlocking, writeNonBlocking, writeNonBlockingDirect, writeNonBlockingInternalpublic NioSocketWrapper(NioChannel channel, NioEndpoint endpoint)
public NioEndpoint.Poller getPoller()
public int interestOps()
public int interestOps(int ops)
public java.util.concurrent.CountDownLatch getReadLatch()
public java.util.concurrent.CountDownLatch getWriteLatch()
protected java.util.concurrent.CountDownLatch resetLatch(java.util.concurrent.CountDownLatch latch)
public void resetReadLatch()
public void resetWriteLatch()
protected java.util.concurrent.CountDownLatch startLatch(java.util.concurrent.CountDownLatch latch,
int cnt)
public void startReadLatch(int cnt)
public void startWriteLatch(int cnt)
protected void awaitLatch(java.util.concurrent.CountDownLatch latch,
long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void awaitReadLatch(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void awaitWriteLatch(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void setSendfileData(NioEndpoint.SendfileData sf)
public NioEndpoint.SendfileData getSendfileData()
public void updateLastWrite()
public long getLastWrite()
public void updateLastRead()
public long getLastRead()
public boolean isReadyForRead()
throws java.io.IOException
isReadyForRead in class SocketWrapperBase<NioChannel>java.io.IOExceptionpublic int read(boolean block,
byte[] b,
int off,
int len)
throws java.io.IOException
read in class SocketWrapperBase<NioChannel>java.io.IOExceptionpublic int read(boolean block,
java.nio.ByteBuffer to)
throws java.io.IOException
read in class SocketWrapperBase<NioChannel>java.io.IOExceptionprotected void doClose()
SocketWrapperBasedoClose in class SocketWrapperBase<NioChannel>protected void doWrite(boolean block,
java.nio.ByteBuffer from)
throws java.io.IOException
SocketWrapperBasedoWrite in class SocketWrapperBase<NioChannel>block - Should the write be blocking or not?from - the ByteBuffer containing the data to be writtenjava.io.IOException - If an I/O error such as a timeout occurs during the
writepublic void registerReadInterest()
registerReadInterest in class SocketWrapperBase<NioChannel>public void registerWriteInterest()
registerWriteInterest in class SocketWrapperBase<NioChannel>public SendfileDataBase createSendfileData(java.lang.String filename, long pos, long length)
createSendfileData in class SocketWrapperBase<NioChannel>public SendfileState processSendfile(SendfileDataBase sendfileData)
SocketWrapperBaseprocessSendfile in class SocketWrapperBase<NioChannel>sendfileData - Data representing the file to sendprotected void populateRemoteAddr()
populateRemoteAddr in class SocketWrapperBase<NioChannel>protected void populateRemoteHost()
populateRemoteHost in class SocketWrapperBase<NioChannel>protected void populateRemotePort()
populateRemotePort in class SocketWrapperBase<NioChannel>protected void populateLocalName()
populateLocalName in class SocketWrapperBase<NioChannel>protected void populateLocalAddr()
populateLocalAddr in class SocketWrapperBase<NioChannel>protected void populateLocalPort()
populateLocalPort in class SocketWrapperBase<NioChannel>public SSLSupport getSslSupport(java.lang.String clientCertProvider)
getSslSupport in class SocketWrapperBase<NioChannel>clientCertProvider - Ignored for this implementationpublic void doClientAuth(SSLSupport sslSupport) throws java.io.IOException
SocketWrapperBasedoClientAuth in class SocketWrapperBase<NioChannel>sslSupport - The SSL/TLS support instance currently being used by
the connection that may need updating after the client
authenticationjava.io.IOException - If authentication is required then there will be I/O
with the client and this exception will be thrown if
that goes wrongpublic void setAppReadBufHandler(ApplicationBufferHandler handler)
setAppReadBufHandler in class SocketWrapperBase<NioChannel>protected <A> SocketWrapperBase.OperationState<A> newOperationState(boolean read, java.nio.ByteBuffer[] buffers, int offset, int length, SocketWrapperBase.BlockingMode block, long timeout, java.util.concurrent.TimeUnit unit, A attachment, SocketWrapperBase.CompletionCheck check, java.nio.channels.CompletionHandler<java.lang.Long,? super A> handler, java.util.concurrent.Semaphore semaphore, SocketWrapperBase.VectoredIOCompletionHandler<A> completion)
newOperationState in class SocketWrapperBase<NioChannel>Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.