public static class NioEndpoint.NioSocketWrapper extends SocketWrapperBase<NioChannel>
SocketWrapperBase.BlockingMode, SocketWrapperBase.CompletionCheck, SocketWrapperBase.CompletionHandlerCall, SocketWrapperBase.CompletionState, SocketWrapperBase.OperationState<A>, SocketWrapperBase.VectoredIOCompletionHandler<A>
bufferedWriteSize, 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 |
---|
NioEndpoint.NioSocketWrapper(NioChannel channel,
NioEndpoint endpoint) |
awaitReadComplete, awaitWriteComplete, buffersArrayHasRemaining, canWrite, checkError, decrementKeepAlive, doWrite, execute, flush, flushBlocking, flushNonBlocking, getEndpoint, getError, getLocalAddr, getLocalName, getLocalPort, getNegotiatedProtocol, getReadTimeout, getRemoteAddr, getRemoteHost, getRemotePort, getSocket, getSocketBufferHandler, getWriteTimeout, hasAsyncIO, hasDataToRead, hasDataToWrite, hasPerOperationTimeout, isReadPending, isReadyForWrite, isSecure, isUpgraded, isWritePending, needSemaphores, populateReadBuffer, populateReadBuffer, processSocket, read, read, read, setError, setKeepAliveLeft, setNegotiatedProtocol, setReadTimeout, setSecure, setUpgraded, setWriteTimeout, toString, transfer, transfer, unRead, vectoredOperation, write, write, write, write, write, writeBlocking, writeBlocking, writeNonBlocking, writeNonBlocking, writeNonBlockingInternal
public NioEndpoint.NioSocketWrapper(NioChannel channel, NioEndpoint endpoint)
public NioEndpoint.Poller getPoller()
public void setPoller(NioEndpoint.Poller poller)
public int interestOps()
public int interestOps(int ops)
public CountDownLatch getReadLatch()
public CountDownLatch getWriteLatch()
protected CountDownLatch resetLatch(CountDownLatch latch)
public void resetReadLatch()
public void resetWriteLatch()
protected CountDownLatch startLatch(CountDownLatch latch, int cnt)
public void startReadLatch(int cnt)
public void startWriteLatch(int cnt)
protected void awaitLatch(CountDownLatch latch, long timeout, TimeUnit unit) throws InterruptedException
InterruptedException
public void awaitReadLatch(long timeout, TimeUnit unit) throws InterruptedException
InterruptedException
public void awaitWriteLatch(long timeout, TimeUnit unit) throws InterruptedException
InterruptedException
public 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 IOException
isReadyForRead
in class SocketWrapperBase<NioChannel>
IOException
public int read(boolean block, byte[] b, int off, int len) throws IOException
read
in class SocketWrapperBase<NioChannel>
IOException
public int read(boolean block, ByteBuffer to) throws IOException
read
in class SocketWrapperBase<NioChannel>
IOException
public void close() throws IOException
close
in class SocketWrapperBase<NioChannel>
IOException
public boolean isClosed()
isClosed
in class SocketWrapperBase<NioChannel>
protected void doWrite(boolean block, ByteBuffer from) throws IOException
SocketWrapperBase
doWrite
in class SocketWrapperBase<NioChannel>
block
- Should the write be blocking or not?from
- the ByteBuffer containing the data to be writtenIOException
- 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(String filename, long pos, long length)
createSendfileData
in class SocketWrapperBase<NioChannel>
public SendfileState processSendfile(SendfileDataBase sendfileData)
SocketWrapperBase
processSendfile
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(String clientCertProvider)
getSslSupport
in class SocketWrapperBase<NioChannel>
clientCertProvider
- Ignored for this implementationpublic void doClientAuth(SSLSupport sslSupport) throws IOException
SocketWrapperBase
doClientAuth
in class SocketWrapperBase<NioChannel>
sslSupport
- The SSL/TLS support instance currently being used by
the connection that may need updating after the client
authenticationIOException
- 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, ByteBuffer[] buffers, int offset, int length, SocketWrapperBase.BlockingMode block, long timeout, TimeUnit unit, A attachment, SocketWrapperBase.CompletionCheck check, CompletionHandler<Long,? super A> handler, Semaphore semaphore, SocketWrapperBase.VectoredIOCompletionHandler<A> completion)
newOperationState
in class SocketWrapperBase<NioChannel>
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.