Package io.activej.net.socket.tcp
Class SslTcpSocket
java.lang.Object
io.activej.reactor.AbstractNioReactive
io.activej.net.socket.tcp.SslTcpSocket
- All Implemented Interfaces:
AsyncCloseable,ITcpSocket,io.activej.reactor.NioReactive,io.activej.reactor.Reactive
public final class SslTcpSocket
extends io.activej.reactor.AbstractNioReactive
implements ITcpSocket
This is an SSL proxy around
ITcpSocket.
It allows SSL connections using Java SSLEngine.
-
Field Summary
FieldsFields inherited from class io.activej.reactor.AbstractNioReactive
reactorFields inherited from interface io.activej.async.process.AsyncCloseable
STATIC -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic SslTcpSocketcreate(io.activej.reactor.nio.NioReactor reactor, ITcpSocket socket, SSLEngine engine, Executor executor) booleanisClosed()booleanread()Operation to read some data from network.static SslTcpSocketwrapClientSocket(io.activej.reactor.nio.NioReactor reactor, ITcpSocket socket, String host, int port, SSLContext sslContext, Executor executor) static SslTcpSocketwrapClientSocket(io.activej.reactor.nio.NioReactor reactor, ITcpSocket socket, SSLContext sslContext, Executor executor) static SslTcpSocketwrapServerSocket(io.activej.reactor.nio.NioReactor reactor, ITcpSocket socket, SSLContext sslContext, Executor executor) Operation to write some data to network.Methods inherited from class io.activej.reactor.AbstractNioReactive
getReactorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.activej.async.process.AsyncCloseable
close
-
Field Details
-
ERROR_ON_CLOSE_WITHOUT_NOTIFY
public static final boolean ERROR_ON_CLOSE_WITHOUT_NOTIFY
-
-
Method Details
-
wrapClientSocket
public static SslTcpSocket wrapClientSocket(io.activej.reactor.nio.NioReactor reactor, ITcpSocket socket, String host, int port, SSLContext sslContext, Executor executor) -
wrapClientSocket
public static SslTcpSocket wrapClientSocket(io.activej.reactor.nio.NioReactor reactor, ITcpSocket socket, SSLContext sslContext, Executor executor) -
wrapServerSocket
public static SslTcpSocket wrapServerSocket(io.activej.reactor.nio.NioReactor reactor, ITcpSocket socket, SSLContext sslContext, Executor executor) -
create
public static SslTcpSocket create(io.activej.reactor.nio.NioReactor reactor, ITcpSocket socket, SSLEngine engine, Executor executor) -
read
Description copied from interface:ITcpSocketOperation to read some data from network. Returns a promise of a bytebuf that represents some data received from network.It is allowed to call read before previous read was completed. However, each consecutive call will cancel all the previous calls (they will not be completed).
- Specified by:
readin interfaceITcpSocket- Returns:
- promise of ByteBuf that represents data received from network
-
write
Description copied from interface:ITcpSocketOperation to write some data to network. Returns a promise of void that represents successful write.Many write operations may be called. However, when some write is successful, all the promises received from write calls before it will be completed at once.
- Specified by:
writein interfaceITcpSocket- Parameters:
buf- data to be sent to network- Returns:
- promise that represents successful write operation
-
isReadAvailable
public boolean isReadAvailable()- Specified by:
isReadAvailablein interfaceITcpSocket
-
closeEx
- Specified by:
closeExin interfaceAsyncCloseable
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceITcpSocket
-