public static class AprEndpoint.AprSocketWrapper extends SocketWrapperBase<java.lang.Long>
SocketWrapperBase.BlockingMode, SocketWrapperBase.CompletionCheck, SocketWrapperBase.CompletionHandlerCall, SocketWrapperBase.CompletionState
bufferedWriteSize, COMPLETE_READ, COMPLETE_READ_WITH_COMPLETION, COMPLETE_WRITE, COMPLETE_WRITE_WITH_COMPLETION, localAddr, localName, localPort, nonBlockingWriteBuffer, READ_DATA, remoteAddr, remoteHost, remotePort, sm, socketBufferHandler
Constructor | Description |
---|---|
AprSocketWrapper(java.lang.Long socket,
AprEndpoint endpoint) |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
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 |
doWrite(boolean block,
java.nio.ByteBuffer from) |
Write the contents of the ByteBuffer to the socket.
|
SSLSupport |
getSslSupport(java.lang.String clientCertProvider) |
|
boolean |
isClosed() |
|
boolean |
isReadyForRead() |
|
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() |
|
void |
setAppReadBufHandler(ApplicationBufferHandler handler) |
|
protected void |
writeBlockingDirect(java.nio.ByteBuffer from) |
Writes directly to the network, bypassing the socket write buffer.
|
protected void |
writeNonBlockingDirect(java.nio.ByteBuffer from) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
awaitReadComplete, awaitWriteComplete, canWrite, checkError, 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, isReadPending, isReadyForWrite, isSecure, isUpgraded, isWritePending, populateReadBuffer, populateReadBuffer, processSocket, read, read, read, setBlockingStatus, setError, setKeepAliveLeft, setNegotiatedProtocol, setReadTimeout, setSecure, setUpgraded, setWriteTimeout, toString, transfer, transfer, unRead, write, write, write, write, write, writeBlocking, writeBlocking, writeNonBlocking, writeNonBlocking, writeNonBlockingInternal
public AprSocketWrapper(java.lang.Long socket, AprEndpoint endpoint)
public int read(boolean block, byte[] b, int off, int len) throws java.io.IOException
read
in class SocketWrapperBase<java.lang.Long>
java.io.IOException
public int read(boolean block, java.nio.ByteBuffer to) throws java.io.IOException
read
in class SocketWrapperBase<java.lang.Long>
java.io.IOException
public boolean isReadyForRead() throws java.io.IOException
isReadyForRead
in class SocketWrapperBase<java.lang.Long>
java.io.IOException
public void close()
close
in class SocketWrapperBase<java.lang.Long>
public boolean isClosed()
isClosed
in class SocketWrapperBase<java.lang.Long>
protected void writeBlockingDirect(java.nio.ByteBuffer from) throws java.io.IOException
SocketWrapperBase
writeBlockingDirect
in class SocketWrapperBase<java.lang.Long>
from
- The ByteBuffer containing the data to be writtenjava.io.IOException
- If an IO error occurs during the writeprotected void writeNonBlockingDirect(java.nio.ByteBuffer from) throws java.io.IOException
writeNonBlockingDirect
in class SocketWrapperBase<java.lang.Long>
java.io.IOException
protected void doWrite(boolean block, java.nio.ByteBuffer from) throws java.io.IOException
SocketWrapperBase
doWrite
in class SocketWrapperBase<java.lang.Long>
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<java.lang.Long>
public void registerWriteInterest()
registerWriteInterest
in class SocketWrapperBase<java.lang.Long>
public SendfileDataBase createSendfileData(java.lang.String filename, long pos, long length)
createSendfileData
in class SocketWrapperBase<java.lang.Long>
public SendfileState processSendfile(SendfileDataBase sendfileData)
SocketWrapperBase
processSendfile
in class SocketWrapperBase<java.lang.Long>
sendfileData
- Data representing the file to sendprotected void populateRemoteAddr()
populateRemoteAddr
in class SocketWrapperBase<java.lang.Long>
protected void populateRemoteHost()
populateRemoteHost
in class SocketWrapperBase<java.lang.Long>
protected void populateRemotePort()
populateRemotePort
in class SocketWrapperBase<java.lang.Long>
protected void populateLocalName()
populateLocalName
in class SocketWrapperBase<java.lang.Long>
protected void populateLocalAddr()
populateLocalAddr
in class SocketWrapperBase<java.lang.Long>
protected void populateLocalPort()
populateLocalPort
in class SocketWrapperBase<java.lang.Long>
public SSLSupport getSslSupport(java.lang.String clientCertProvider)
getSslSupport
in class SocketWrapperBase<java.lang.Long>
public void doClientAuth(SSLSupport sslSupport) throws java.io.IOException
SocketWrapperBase
doClientAuth
in class SocketWrapperBase<java.lang.Long>
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<java.lang.Long>
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.