P - the type of payload for outbound messagespublic class ReactorNettyTcpConnection<P> extends java.lang.Object implements TcpConnection<P>
TcpConnection.| Modifier and Type | Field and Description |
|---|---|
private <any> |
closeProcessor |
private ReactorNettyCodec<P> |
codec |
private NettyInbound |
inbound |
private NettyOutbound |
outbound |
| Constructor and Description |
|---|
ReactorNettyTcpConnection(NettyInbound inbound,
NettyOutbound outbound,
ReactorNettyCodec<P> codec,
<any> closeProcessor) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection.
|
void |
onReadInactivity(java.lang.Runnable runnable,
long inactivityDuration)
Register a task to invoke after a period of read inactivity.
|
void |
onWriteInactivity(java.lang.Runnable runnable,
long inactivityDuration)
Register a task to invoke after a period of write inactivity.
|
ListenableFuture<java.lang.Void> |
send(Message<P> message)
Send the given message.
|
private final NettyInbound inbound
private final NettyOutbound outbound
private final ReactorNettyCodec<P> codec
private final <any> closeProcessor
public ReactorNettyTcpConnection(NettyInbound inbound,
NettyOutbound outbound,
ReactorNettyCodec<P> codec,
<any> closeProcessor)
public ListenableFuture<java.lang.Void> send(Message<P> message)
TcpConnectionsend in interface TcpConnection<P>message - the messagepublic void onReadInactivity(java.lang.Runnable runnable,
long inactivityDuration)
TcpConnectiononReadInactivity in interface TcpConnection<P>runnable - the task to invokeinactivityDuration - the amount of inactive time in millisecondspublic void onWriteInactivity(java.lang.Runnable runnable,
long inactivityDuration)
TcpConnectiononWriteInactivity in interface TcpConnection<P>runnable - the task to invokeinactivityDuration - the amount of inactive time in millisecondspublic void close()
TcpConnectionclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface TcpConnection<P>