public static class AprEndpoint.AprSocketWrapper extends SocketWrapperBase<Long>
SocketWrapperBase.CompletionCheck, SocketWrapperBase.CompletionHandlerCall, SocketWrapperBase.CompletionState
bufferedWrites, bufferedWriteSize, COMPLETE_WRITE, localAddr, localName, localPort, READ_DATA, remoteAddr, remoteHost, remotePort, sm, socketBufferHandler
Constructor and Description |
---|
AprSocketWrapper(Long socket,
AprEndpoint endpoint) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
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 |
doWriteInternal(boolean block)
Write the contents of the socketWriteBuffer to the socket.
|
SSLSupport |
getSslSupport(String clientCertProvider) |
boolean |
isReadPending() |
boolean |
isReadyForRead() |
boolean |
isWritePending() |
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) |
<A> SocketWrapperBase.CompletionState |
read(ByteBuffer[] dsts,
int offset,
int length,
boolean block,
long timeout,
TimeUnit unit,
A attachment,
SocketWrapperBase.CompletionCheck check,
CompletionHandler<Long,? super A> handler)
Scatter read.
|
void |
registerReadInterest() |
void |
registerWriteInterest() |
<A> SocketWrapperBase.CompletionState |
write(ByteBuffer[] srcs,
int offset,
int length,
boolean block,
long timeout,
TimeUnit unit,
A attachment,
SocketWrapperBase.CompletionCheck check,
CompletionHandler<Long,? super A> handler)
Gather write.
|
addToBuffers, canWrite, decrementKeepAlive, doWrite, executeNonBlockingDispatches, flush, flushBlocking, flushNonBlocking, getBlockingStatus, getBlockingStatusReadLock, getBlockingStatusWriteLock, getEndpoint, getLocalAddr, getLocalName, getLocalPort, getNegotiatedProtocol, getReadTimeout, getRemoteAddr, getRemoteHost, getRemotePort, getSocket, getSocketBufferHandler, getWriteThreadLock, getWriteTimeout, hasAsyncIO, hasDataToWrite, isKeptAlive, isReadyForWrite, isSecure, isUpgraded, processSocket, read, setBlockingStatus, setKeepAliveLeft, setKeptAlive, setNegotiatedProtocol, setReadTimeout, setSecure, setUpgraded, setWriteTimeout, toString, transfer, transfer, unRead, write, write, writeBlocking, writeNonBlocking
public AprSocketWrapper(Long socket, AprEndpoint endpoint)
public int read(boolean block, byte[] b, int off, int len) throws IOException
read
in class SocketWrapperBase<Long>
IOException
public boolean isReadyForRead() throws IOException
isReadyForRead
in class SocketWrapperBase<Long>
IOException
public void close()
close
in class SocketWrapperBase<Long>
protected void doWriteInternal(boolean block) throws IOException
SocketWrapperBase
doWriteInternal
in class SocketWrapperBase<Long>
block
- Should the write be blocking or not?IOException
- If an I/O error such as a timeout occurs during the
writepublic boolean isReadPending()
isReadPending
in class SocketWrapperBase<Long>
public 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)
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
authenticationpublic boolean isWritePending()
isWritePending
in class SocketWrapperBase<Long>
public <A> SocketWrapperBase.CompletionState read(ByteBuffer[] dsts, int offset, int length, boolean block, long timeout, TimeUnit unit, A attachment, SocketWrapperBase.CompletionCheck check, CompletionHandler<Long,? super A> handler)
SocketWrapperBase
read
in class SocketWrapperBase<Long>
dsts
- buffersoffset
- in the buffer arraylength
- in the buffer arrayblock
- true to block until any pending read is done, if the
timeout occurs and a read is still pending, a
ReadPendingException will be thrown; false to
not block but any pending read operation will cause
a ReadPendingExceptioncheck
- for the IO operation completionhandler
- to call when the IO is completepublic <A> SocketWrapperBase.CompletionState write(ByteBuffer[] srcs, int offset, int length, boolean block, long timeout, TimeUnit unit, A attachment, SocketWrapperBase.CompletionCheck check, CompletionHandler<Long,? super A> handler)
SocketWrapperBase
write
in class SocketWrapperBase<Long>
srcs
- buffersoffset
- in the buffer arraylength
- in the buffer arrayblock
- true to block until any pending write is done, if the
timeout occurs and a write is still pending, a
WritePendingException will be thrown; false to
not block but any pending write operation will cause
a WritePendingExceptioncheck
- for the IO operation completionhandler
- to call when the IO is completeCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.