public static class AprEndpoint.AprSocketWrapper extends SocketWrapperBase<Long>
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, currentProcessor, localAddr, localName, localPort, nonBlockingWriteBuffer, READ_DATA, readOperation, readPending, remoteAddr, remoteHost, remotePort, sm, socketBufferHandler, writeOperation, writePending
Constructor and Description |
---|
AprSocketWrapper(Long socket,
AprEndpoint endpoint) |
Modifier and Type | Method and Description |
---|---|
SendfileDataBase |
createSendfileData(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,
ByteBuffer from)
Write the contents of the ByteBuffer to the socket.
|
boolean |
getBlockingStatus() |
Lock |
getBlockingStatusReadLock() |
ReentrantReadWriteLock.WriteLock |
getBlockingStatusWriteLock() |
SSLSupport |
getSslSupport(String clientCertProvider) |
boolean |
isReadyForRead() |
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) |
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,
ByteBuffer to) |
void |
registerReadInterest() |
void |
registerWriteInterest() |
void |
setAppReadBufHandler(ApplicationBufferHandler handler) |
void |
setBlockingStatus(boolean blockingStatus) |
awaitReadComplete, awaitWriteComplete, buffersArrayHasRemaining, canWrite, checkError, close, decrementKeepAlive, doWrite, execute, flush, flushBlocking, flushNonBlocking, getCurrentProcessor, 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, setCurrentProcessor, setError, setKeepAliveLeft, setNegotiatedProtocol, setReadTimeout, setSecure, setUpgraded, setWriteTimeout, toString, transfer, transfer, unRead, vectoredOperation, write, write, write, write, write, writeBlocking, writeBlocking, writeNonBlocking, writeNonBlocking, writeNonBlockingInternal
public AprSocketWrapper(Long socket, AprEndpoint endpoint)
public boolean getBlockingStatus()
public void setBlockingStatus(boolean blockingStatus)
public Lock getBlockingStatusReadLock()
public ReentrantReadWriteLock.WriteLock getBlockingStatusWriteLock()
public int read(boolean block, byte[] b, int off, int len) throws IOException
read
in class SocketWrapperBase<Long>
IOException
public int read(boolean block, ByteBuffer to) throws IOException
read
in class SocketWrapperBase<Long>
IOException
public boolean isReadyForRead() throws IOException
isReadyForRead
in class SocketWrapperBase<Long>
IOException
protected void doClose()
SocketWrapperBase
doClose
in class SocketWrapperBase<Long>
protected void doWrite(boolean block, ByteBuffer from) throws IOException
SocketWrapperBase
doWrite
in class SocketWrapperBase<Long>
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<Long>
public void registerWriteInterest()
registerWriteInterest
in class SocketWrapperBase<Long>
public SendfileDataBase createSendfileData(String filename, long pos, long length)
createSendfileData
in class SocketWrapperBase<Long>
public SendfileState processSendfile(SendfileDataBase sendfileData)
SocketWrapperBase
processSendfile
in class SocketWrapperBase<Long>
sendfileData
- Data representing the file to sendprotected void populateRemoteAddr()
populateRemoteAddr
in class SocketWrapperBase<Long>
protected void populateRemoteHost()
populateRemoteHost
in class SocketWrapperBase<Long>
protected void populateRemotePort()
populateRemotePort
in class SocketWrapperBase<Long>
protected void populateLocalName()
populateLocalName
in class SocketWrapperBase<Long>
protected void populateLocalAddr()
populateLocalAddr
in class SocketWrapperBase<Long>
protected void populateLocalPort()
populateLocalPort
in class SocketWrapperBase<Long>
public SSLSupport getSslSupport(String clientCertProvider)
getSslSupport
in class SocketWrapperBase<Long>
public void doClientAuth(SSLSupport sslSupport) throws IOException
SocketWrapperBase
doClientAuth
in class SocketWrapperBase<Long>
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<Long>
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<Long>
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.