public class SSLSocketChannel2 extends Object implements ByteChannel, WrappedByteChannel
| Modifier and Type | Field and Description |
|---|---|
protected static ByteBuffer |
emptybuffer |
protected SSLEngineResult |
engineResult |
protected ExecutorService |
exec |
protected ByteBuffer |
inCrypt
encrypted data incoming
|
protected ByteBuffer |
inData
raw payload incomming
|
protected ByteBuffer |
outCrypt
encrypted data outgoing
|
protected SelectionKey |
selectionKey
used to set interestOP SelectionKey.OP_WRITE for the underlying channel
|
protected SocketChannel |
socketChannel
the underlying channel
|
protected SSLEngine |
sslEngine |
protected List<Future<?>> |
tasks |
| Constructor and Description |
|---|
SSLSocketChannel2(SocketChannel channel,
SSLEngine sslEngine,
ExecutorService exec,
SelectionKey key) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
SelectableChannel |
configureBlocking(boolean b) |
boolean |
connect(SocketAddress remote) |
protected void |
consumeDelegatedTasks() |
protected void |
createBuffers(SSLSession session) |
boolean |
finishConnect() |
boolean |
isBlocking() |
boolean |
isConnected() |
boolean |
isInboundDone() |
boolean |
isNeedRead()
returns whether readMore should be called to fetch data which has been decoded but not yet been returned.
|
boolean |
isNeedWrite() |
boolean |
isOpen() |
int |
read(ByteBuffer dst)
Blocks when in blocking mode until at least one byte has been decoded.
When not in blocking mode 0 may be returned. |
int |
readMore(ByteBuffer dst)
This function does not read data from the underlying channel at all.
|
Socket |
socket() |
int |
write(ByteBuffer src) |
void |
writeMore() |
protected static ByteBuffer emptybuffer
protected ExecutorService exec
protected ByteBuffer inData
protected ByteBuffer outCrypt
protected ByteBuffer inCrypt
protected SocketChannel socketChannel
protected SelectionKey selectionKey
protected SSLEngineResult engineResult
protected SSLEngine sslEngine
public SSLSocketChannel2(SocketChannel channel, SSLEngine sslEngine, ExecutorService exec, SelectionKey key) throws IOException
IOExceptionprotected void consumeDelegatedTasks()
protected void createBuffers(SSLSession session)
public int write(ByteBuffer src) throws IOException
write in interface WritableByteChannelIOExceptionpublic int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelIOExceptionpublic boolean isConnected()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ChannelIOExceptionpublic SelectableChannel configureBlocking(boolean b) throws IOException
IOExceptionpublic boolean connect(SocketAddress remote) throws IOException
IOExceptionpublic boolean finishConnect()
throws IOException
IOExceptionpublic Socket socket()
public boolean isInboundDone()
public boolean isNeedWrite()
isNeedWrite in interface WrappedByteChannelpublic void writeMore()
throws IOException
writeMore in interface WrappedByteChannelIOExceptionpublic boolean isNeedRead()
WrappedByteChannelisNeedRead in interface WrappedByteChannelReadableByteChannel.read(ByteBuffer),
WrappedByteChannel.readMore(ByteBuffer)public int readMore(ByteBuffer dst) throws SSLException
WrappedByteChannelReadableByteChannel.read(ByteBuffer).readMore in interface WrappedByteChannelSSLExceptionpublic boolean isBlocking()
isBlocking in interface WrappedByteChannelCopyright © 2013. All Rights Reserved.