| java.lang.Object org.apache.tomcat.util.net.NioChannel org.apache.tomcat.util.net.SecureNioChannel
SecureNioChannel | public class SecureNioChannel extends NioChannel (Code) | | Implementation of a secure socket channel
author: Filip Hanik version: 1.0 |
Inner Class :public static interface ApplicationBufferHandler | |
closed | protected boolean closed(Code) | | |
closing | protected boolean closing(Code) | | |
initHandshakeComplete | protected boolean initHandshakeComplete(Code) | | |
initHandshakeStatus | protected HandshakeStatus initHandshakeStatus(Code) | | |
netInBuffer | protected ByteBuffer netInBuffer(Code) | | |
netOutBuffer | protected ByteBuffer netOutBuffer(Code) | | |
close | public void close() throws IOException(Code) | | Sends a SSL close message, will not physically close the connection here.
To close the connection, you could do something like
close();
while (isOpen() && !myTimeoutFunction()) Thread.sleep(25);
if ( isOpen() ) close(true); //forces a close if you timed out
throws: IOException - if an I/O error occurs throws: IOException - if there is data on the outgoing network buffer and we are unable to flush it |
close | public void close(boolean force) throws IOException(Code) | | Force a close, can throw an IOException
Parameters: force - boolean throws: IOException - |
flush | public boolean flush(boolean block, Selector s, long timeout) throws IOException(Code) | | returns true if the network buffer has
been flushed out and is empty
boolean |
flush | protected boolean flush(ByteBuffer buf) throws IOException(Code) | | Flushes the buffer to the network, non blocking
Parameters: buf - ByteBuffer boolean true if the buffer has been emptied out, false otherwise throws: IOException - |
getBufHandler | public ApplicationBufferHandler getBufHandler()(Code) | | |
getBufferSize | public int getBufferSize()(Code) | | |
getEmptyBuf | public ByteBuffer getEmptyBuf()(Code) | | |
handshake | public int handshake(boolean read, boolean write) throws IOException(Code) | | Performs SSL handshake, non blocking, but performs NEED_TASK on the same thread.
Hence, you should never call this method using your Acceptor thread, as you would slow down
your system significantly.
The return for this operation is 0 if the handshake is complete and a positive value if it is not complete.
In the event of a positive value coming back, reregister the selection key for the return values interestOps.
Parameters: read - boolean - true if the underlying channel is readable Parameters: write - boolean - true if the underlying channel is writable int - 0 if hand shake is complete, otherwise it returns a SelectionKey interestOps value throws: IOException - |
isClosing | public boolean isClosing()(Code) | | |
isInitHandshakeComplete | public boolean isInitHandshakeComplete()(Code) | | |
read | public int read(ByteBuffer dst) throws IOException(Code) | | Reads a sequence of bytes from this channel into the given buffer.
Parameters: dst - The buffer into which bytes are to be transferred The number of bytes read, possibly zero, or -1 if the channel has reached end-of-stream throws: IOException - If some other I/O error occurs throws: IllegalArgumentException - if the destination buffer is different than bufHandler.getReadBuffer() |
setBufHandler | public void setBufHandler(ApplicationBufferHandler bufHandler)(Code) | | |
write | public int write(ByteBuffer src) throws IOException(Code) | | Writes a sequence of bytes to this channel from the given buffer.
Parameters: src - The buffer from which bytes are to be retrieved The number of bytes written, possibly zero throws: IOException - If some other I/O error occurs |
|
|