Package jp.cssj.driver.ctip.v2
Class TLSSocketChannel
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.SelectableChannel
jp.cssj.driver.ctip.v2.TLSSocketChannel
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,InterruptibleChannel,ReadableByteChannel,WritableByteChannel
Nonblocking TLS transport. Waiting belongs to ChannelIO, never to an engine lock.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidChannelIO wait registration also makes a direct TLS close wake its selectors.configureBlocking(boolean block) booleanconnect(SocketAddress remote) booleanconnect(SocketAddress remote, String host, int port, long timeout) Connects, then verifies the peer unless the caller asked not to.booleanAdvance pending ciphertext and TLS control output without more application data.booleanbooleanprotected voidbooleanbooleanbooleanprovider()intread(ByteBuffer dst) voidremoveWaiter(Selector selector) intintintvalidOps()intwrite(ByteBuffer src) Methods inherited from class java.nio.channels.SelectableChannel
registerMethods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
Field Details
-
DEFAULT_CONNECT_TIMEOUT
public static final long DEFAULT_CONNECT_TIMEOUT- See Also:
-
CLOSE_TIMEOUT
public static final long CLOSE_TIMEOUT- See Also:
-
-
Constructor Details
-
TLSSocketChannel
-
-
Method Details
-
connect
- Throws:
IOException
-
connect
public boolean connect(SocketAddress remote, String host, int port, long timeout) throws IOException Connects, then verifies the peer unless the caller asked not to.- Throws:
IOException
-
flushOutbound
Advance pending ciphertext and TLS control output without more application data.- Throws:
IOException
-
write
- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-
read
- Specified by:
readin interfaceReadableByteChannel- Throws:
IOException
-
hasPlaintext
public boolean hasPlaintext() -
hasPendingOutbound
public boolean hasPendingOutbound() -
requiredOps
public int requiredOps() -
requiredWriteOps
public int requiredWriteOps() -
isConnected
public boolean isConnected() -
configureBlocking
- Specified by:
configureBlockingin classSelectableChannel- Throws:
IOException
-
blockingLock
- Specified by:
blockingLockin classSelectableChannel
-
isBlocking
public boolean isBlocking()- Specified by:
isBlockingin classSelectableChannel
-
isRegistered
public boolean isRegistered()- Specified by:
isRegisteredin classSelectableChannel
-
keyFor
- Specified by:
keyForin classSelectableChannel
-
provider
- Specified by:
providerin classSelectableChannel
-
register
public SelectionKey register(Selector selector, int ops, Object attachment) throws ClosedChannelException - Specified by:
registerin classSelectableChannel- Throws:
ClosedChannelException
-
validOps
public int validOps()- Specified by:
validOpsin classSelectableChannel
-
addWaiter
ChannelIO wait registration also makes a direct TLS close wake its selectors. -
removeWaiter
-
implCloseChannel
- Specified by:
implCloseChannelin classAbstractInterruptibleChannel- Throws:
IOException
-