N - the type of NetworkContextpublic final class SslDelegatingTcpHandler<N extends SslNetworkContext> extends Object implements TcpHandler<N>, NetworkContextManager<N>
TcpHandler, providing
symmetric encryption/decryption transparently to the underlying handler.
When process is called by the TcpEventHandler,
this class will first attempt to perform an SSL handshake with the remote
connection. This is a blocking operation, and the process
call will not return until the handshake is successful, or fails.
Further operation is delegated to the SslEngineStateMachine class,
which manages the conversion of data between plain-text and cipher-text
either end of the network connection.
| Constructor and Description |
|---|
SslDelegatingTcpHandler(TcpHandler<N> delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
hasClientClosed() |
boolean |
isClosed() |
N |
nc() |
void |
nc(N nc) |
void |
notifyClosing() |
void |
onEndOfConnection(boolean heartbeatTimeOut) |
void |
onReadComplete() |
void |
onReadTime(long readTimeNS) |
void |
onWriteTime(long writeTimeNS) |
void |
process(net.openhft.chronicle.bytes.Bytes in,
net.openhft.chronicle.bytes.Bytes out,
N nc)
The server reads the bytes
in from the client and sends a response out back
to the client. |
void |
sendHeartBeat(net.openhft.chronicle.bytes.Bytes out,
SessionDetailsProvider sessionDetails) |
public SslDelegatingTcpHandler(TcpHandler<N> delegate)
public void process(@NotNull
net.openhft.chronicle.bytes.Bytes in,
@NotNull
net.openhft.chronicle.bytes.Bytes out,
N nc)
in from the client and sends a response out back
to the client.process in interface TcpHandler<N extends SslNetworkContext>in - the bytes send from the clientout - the response send back to the clientpublic void sendHeartBeat(net.openhft.chronicle.bytes.Bytes out,
SessionDetailsProvider sessionDetails)
sendHeartBeat in interface TcpHandler<N extends SslNetworkContext>public void onEndOfConnection(boolean heartbeatTimeOut)
onEndOfConnection in interface TcpHandler<N extends SslNetworkContext>public void close()
close in interface Closeableclose in interface AutoCloseableclose in interface TcpHandler<N extends SslNetworkContext>public void onReadTime(long readTimeNS)
onReadTime in interface TcpHandler<N extends SslNetworkContext>public void onWriteTime(long writeTimeNS)
onWriteTime in interface TcpHandler<N extends SslNetworkContext>public void onReadComplete()
onReadComplete in interface TcpHandler<N extends SslNetworkContext>public boolean hasClientClosed()
hasClientClosed in interface ClientClosedProvidertrue if the client has intentionally closedpublic void notifyClosing()
public boolean isClosed()
public N nc()
nc in interface NetworkContextManager<N extends SslNetworkContext>public void nc(N nc)
nc in interface NetworkContextManager<N extends SslNetworkContext>Copyright © 2018. All rights reserved.