public class SSLSocketChannel2 extends Object implements ByteChannel, WrappedByteChannel
Modifier and Type | Field and Description |
---|---|
protected int |
bufferallocations
Should be used to count the buffer allocations.
|
protected static ByteBuffer |
emptybuffer
This object is used to feed the
SSLEngine 's wrap and unwrap methods during the handshake phase. |
protected ExecutorService |
exec |
protected ByteBuffer |
inCrypt
encrypted data incoming
|
protected ByteBuffer |
inData
raw payload incomming
|
protected ByteBuffer |
outCrypt
encrypted data outgoing
|
protected SSLEngineResult |
readEngineResult |
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 |
protected SSLEngineResult |
writeEngineResult |
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
SSLEngine
's wrap and unwrap methods during the handshake phase.protected ExecutorService exec
protected ByteBuffer inData
protected ByteBuffer outCrypt
protected ByteBuffer inCrypt
protected SocketChannel socketChannel
protected SelectionKey selectionKey
protected SSLEngine sslEngine
protected SSLEngineResult readEngineResult
protected SSLEngineResult writeEngineResult
protected int bufferallocations
createBuffers(SSLSession)
needs to be called.public SSLSocketChannel2(SocketChannel channel, SSLEngine sslEngine, ExecutorService exec, SelectionKey key) throws IOException
IOException
protected void consumeDelegatedTasks()
protected void createBuffers(SSLSession session)
public int write(ByteBuffer src) throws IOException
write
in interface WritableByteChannel
IOException
public int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
IOException
public boolean isConnected()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
IOException
public SelectableChannel configureBlocking(boolean b) throws IOException
IOException
public boolean connect(SocketAddress remote) throws IOException
IOException
public boolean finishConnect() throws IOException
IOException
public Socket socket()
public boolean isInboundDone()
public boolean isNeedWrite()
isNeedWrite
in interface WrappedByteChannel
public void writeMore() throws IOException
writeMore
in interface WrappedByteChannel
IOException
public boolean isNeedRead()
WrappedByteChannel
isNeedRead
in interface WrappedByteChannel
ReadableByteChannel.read(ByteBuffer)
,
WrappedByteChannel.readMore(ByteBuffer)
public int readMore(ByteBuffer dst) throws SSLException
WrappedByteChannel
ReadableByteChannel.read(ByteBuffer)
.readMore
in interface WrappedByteChannel
SSLException
public boolean isBlocking()
isBlocking
in interface WrappedByteChannel
Copyright © 2016. All rights reserved.