| 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 |
| protected ExecutorService | |
| protected ByteBuffer | inCrypt
encrypted data incoming |
| protected ByteBuffer | inData
raw payload incoming |
| private final Logger | log
Logger instance |
| protected ByteBuffer | outCrypt
encrypted data outgoing |
| protected SSLEngineResult | |
| private byte[] | |
| protected SelectionKey | selectionKey
used to set interestOP SelectionKey.OP_WRITE for the underlying channel |
| protected SocketChannel | socketChannel
the underlying channel |
| protected SSLEngine | |
| protected List | |
| protected SSLEngineResult |
| Access | Constructor and Description |
|---|---|
| public | SSLSocketChannel2(SocketChannel channel, SSLEngine sslEngine, ExecutorService exec, SelectionKey key)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public SelectableChannel | |
| public boolean | |
| protected void | |
| private void | |
| protected void | |
| public boolean | |
| public SSLEngine | getSSLEngine()
Implements org. Get the ssl engine used for the de- and encryption of the communication. |
| public boolean | isBlocking()
Implements org. This function returns the blocking state of the channel |
| public boolean | |
| private boolean | |
| public boolean | |
| public boolean | isNeedRead()
Implements org. returns whether readMore should be called to fetch data which has been decoded but not yet been returned. |
| public boolean | isNeedWrite()
Implements org. returns whether writeMore should be called write additional data. |
| public boolean | |
| private synchronized void | processHandshake(boolean isReading)
This method will do whatever necessary to process the sslEngine handshake. |
| public int | Returns: the number of bytes read.Implements java. Blocks when in blocking mode until at least one byte has been decoded. |
| public int | readMore(ByteBuffer dst)
Implements org. This function does not read data from the underlying channel at all. |
| private int | |
| private void | |
| public Socket | |
| private int | |
| private void | |
| private synchronized ByteBuffer | |
| private synchronized ByteBuffer | |
| public int | write(ByteBuffer src)
Implements java. Writes a sequence of bytes to this channel from the given buffer. |
| public void | writeMore()
Implements org. Gets called when |
| bufferallocations | back to summary |
|---|---|
| protected int bufferallocations Should be used to count the buffer allocations. But because of #190 where
HandshakeStatus.FINISHED is not properly returned by nio wrap/unwrap this variable is used to
check whether | |
| emptybuffer | back to summary |
|---|---|
| protected static ByteBuffer emptybuffer This object is used to feed the | |
| exec | back to summary |
|---|---|
| protected ExecutorService exec | |
| inCrypt | back to summary |
|---|---|
| protected ByteBuffer inCrypt encrypted data incoming | |
| inData | back to summary |
|---|---|
| protected ByteBuffer inData raw payload incoming | |
| log | back to summary |
|---|---|
| private final Logger log Logger instance
| |
| outCrypt | back to summary |
|---|---|
| protected ByteBuffer outCrypt encrypted data outgoing | |
| readEngineResult | back to summary |
|---|---|
| protected SSLEngineResult readEngineResult | |
| saveCryptData | back to summary |
|---|---|
| private byte[] saveCryptData | |
| selectionKey | back to summary |
|---|---|
| protected SelectionKey selectionKey used to set interestOP SelectionKey.OP_WRITE for the underlying channel | |
| socketChannel | back to summary |
|---|---|
| protected SocketChannel socketChannel the underlying channel | |
| sslEngine | back to summary |
|---|---|
| protected SSLEngine sslEngine | |
| tasks | back to summary |
|---|---|
| protected List<Future<?>> tasks | |
| writeEngineResult | back to summary |
|---|---|
| protected SSLEngineResult writeEngineResult | |
| SSLSocketChannel2 | back to summary |
|---|---|
| public SSLSocketChannel2(SocketChannel channel, SSLEngine sslEngine, ExecutorService exec, SelectionKey key) throws IOException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this channel. After a channel is closed, any further attempt to invoke I/O
operations upon it will cause a If this channel is already closed then invoking this method has no effect. This method may be invoked at any time. If some other thread has already invoked it, however, then another invocation will block until the first invocation is complete, after which it will return without effect.
| |
| configureBlocking | back to summary |
|---|---|
| public SelectableChannel configureBlocking(boolean b) throws IOException | |
| connect | back to summary |
|---|---|
| public boolean connect(SocketAddress remote) throws IOException | |
| consumeDelegatedTasks | back to summary |
|---|---|
| protected void consumeDelegatedTasks() | |
| consumeFutureUninterruptible | back to summary |
|---|---|
| private void consumeFutureUninterruptible(Future<?> f) | |
| createBuffers | back to summary |
|---|---|
| protected void createBuffers(SSLSession session) | |
| finishConnect | back to summary |
|---|---|
| public boolean finishConnect() throws IOException | |
| getSSLEngine | back to summary |
|---|---|
| public SSLEngine getSSLEngine() Implements org. Doc from org. Get the ssl engine used for the de- and encryption of the communication.
| |
| isBlocking | back to summary |
|---|---|
| public boolean isBlocking() Implements org. Doc from org. This function returns the blocking state of the channel
| |
| isConnected | back to summary |
|---|---|
| public boolean isConnected() | |
| isHandShakeComplete | back to summary |
|---|---|
| private boolean isHandShakeComplete() | |
| isInboundDone | back to summary |
|---|---|
| public boolean isInboundDone() | |
| isNeedRead | back to summary |
|---|---|
| public boolean isNeedRead() Implements org. Doc from org. returns whether readMore should be called to fetch data which has been decoded but not yet been returned.
| |
| isNeedWrite | back to summary |
|---|---|
| public boolean isNeedWrite() Implements org. Doc from org. returns whether writeMore should be called write additional data.
| |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements java. Doc from java. Tells whether or not this channel is open.
| |
| processHandshake | back to summary |
|---|---|
| private synchronized void processHandshake(boolean isReading) throws IOException This method will do whatever necessary to process the sslEngine handshake. Thats why it's
called both from the | |
| read | back to summary |
|---|---|
| public int read(ByteBuffer dst) throws IOException Implements java. Blocks when in blocking mode until at least one byte has been decoded.
| |
| readMore | back to summary |
|---|---|
| public int readMore(ByteBuffer dst) throws SSLException Implements org. Doc from org. This function does not read data from the underlying channel at all. It is just a way to fetch
data which has already be received or decoded but was but was not yet returned to the user.
This could be the case when the decoded data did not fit into the buffer the user passed to
| |
| readRemaining | back to summary |
|---|---|
| private int readRemaining(ByteBuffer dst) throws SSLException
| |
| saveCryptedData | back to summary |
|---|---|
| private void saveCryptedData() | |
| socket | back to summary |
|---|---|
| public Socket socket() | |
| transfereTo | back to summary |
|---|---|
| private int transfereTo(ByteBuffer from, ByteBuffer to) | |
| tryRestoreCryptedData | back to summary |
|---|---|
| private void tryRestoreCryptedData() | |
| unwrap | back to summary |
|---|---|
| private synchronized ByteBuffer unwrap() throws SSLException performs the unwrap operation by unwrapping from | |
| wrap | back to summary |
|---|---|
| private synchronized ByteBuffer wrap(ByteBuffer b) throws SSLException | |
| write | back to summary |
|---|---|
| public int write(ByteBuffer src) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from the given buffer. An attempt is made to write up to r bytes to the channel,
where r is the number of bytes remaining in the buffer, that is,
Suppose that a byte sequence of length n is written, where
Unless otherwise specified, a write operation will return only after writing all of the r requested bytes. Some types of channels, depending upon their state, may write only some of the bytes or possibly none at all. A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer. This method may be invoked at any time. If another thread has already initiated a write operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| writeMore | back to summary |
|---|---|
| public void writeMore() throws IOException Implements org. Doc from org. Gets called when
| |