-
- All Implemented Interfaces:
-
com.tds.common.websocket.conn.WrappedByteChannel
,com.tds.common.websocket.interfaces.ISSLChannel
,java.io.Closeable
,java.lang.AutoCloseable
,java.nio.channels.ByteChannel
,java.nio.channels.Channel
,java.nio.channels.ReadableByteChannel
,java.nio.channels.WritableByteChannel
public class SSLSocketChannel2 implements ByteChannel, WrappedByteChannel, ISSLChannel
Implements the relevant portions of the SocketChannel interface with the SSLEngine wrapper.
-
-
Constructor Summary
Constructors Constructor Description SSLSocketChannel2(SocketChannel channel, SSLEngine sslEngine, ExecutorService exec, SelectionKey key)
-
Method Summary
Modifier and Type Method Description SSLEngine
getSSLEngine()
Get the ssl engine used for the de- and encryption of the communication. int
write(ByteBuffer src)
int
read(ByteBuffer dst)
Blocks when in blocking mode until at least one byte has been decoded. boolean
isConnected()
void
close()
SelectableChannel
configureBlocking(boolean b)
boolean
connect(SocketAddress remote)
boolean
finishConnect()
Socket
socket()
boolean
isInboundDone()
boolean
isOpen()
boolean
isNeedWrite()
returns whether writeMore should be called write additional data. void
writeMore()
Gets called when isNeedWrite ()} requires a additional rite boolean
isNeedRead()
returns whether readMore should be called to fetch data which has been decoded but not yet beenreturned. int
readMore(ByteBuffer dst)
This function does not read data from the underlying channel at all. boolean
isBlocking()
This function returns the blocking state of the channel -
Methods inherited from class java.nio.channels.ReadableByteChannel
read
-
Methods inherited from class java.nio.channels.Channel
close, isOpen
-
Methods inherited from class java.nio.channels.WritableByteChannel
write
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
SSLSocketChannel2
SSLSocketChannel2(SocketChannel channel, SSLEngine sslEngine, ExecutorService exec, SelectionKey key)
-
-
Method Detail
-
getSSLEngine
SSLEngine getSSLEngine()
Get the ssl engine used for the de- and encryption of the communication.
-
write
int write(ByteBuffer src)
-
read
int read(ByteBuffer dst)
Blocks when in blocking mode until at least one byte has been decoded. When not in blockingmode 0 may be returned.
-
isConnected
boolean isConnected()
-
close
void close()
-
configureBlocking
SelectableChannel configureBlocking(boolean b)
-
connect
boolean connect(SocketAddress remote)
-
finishConnect
boolean finishConnect()
-
isInboundDone
boolean isInboundDone()
-
isOpen
boolean isOpen()
-
isNeedWrite
boolean isNeedWrite()
returns whether writeMore should be called write additional data.
-
writeMore
void writeMore()
Gets called when isNeedWrite ()} requires a additional rite
-
isNeedRead
boolean isNeedRead()
returns whether readMore should be called to fetch data which has been decoded but not yet beenreturned.
-
readMore
int readMore(ByteBuffer dst)
This function does not read data from the underlying channel at all. It is just a way to fetchdata 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 read.
- Parameters:
dst
- the destiny of the read
-
isBlocking
boolean isBlocking()
This function returns the blocking state of the channel
-
-
-
-