Class ReactorNetty2TcpConnection<P>
java.lang.Object
org.springframework.messaging.tcp.reactor.ReactorNetty2TcpConnection<P>
- Type Parameters:
- P- the type of payload for outbound messages
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- TcpConnection<P>
Reactor Netty based implementation of 
TcpConnection.
 This class is based on ReactorNettyTcpConnection.
- Since:
- 6.0
- Author:
- Rossen Stoyanchev
- 
Constructor SummaryConstructorsConstructorDescriptionReactorNetty2TcpConnection(reactor.netty5.NettyInbound inbound, reactor.netty5.NettyOutbound outbound, TcpMessageCodec<P> codec, reactor.core.publisher.Sinks.Empty<Void> completionSink) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Close the connection.voidonReadInactivity(Runnable runnable, long inactivityDuration) Register a task to invoke after a period of read inactivity.voidonWriteInactivity(Runnable runnable, long inactivityDuration) Register a task to invoke after a period of write inactivity.Send the given message.toString()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.messaging.tcp.TcpConnectionsend
- 
Constructor Details- 
ReactorNetty2TcpConnectionpublic ReactorNetty2TcpConnection(reactor.netty5.NettyInbound inbound, reactor.netty5.NettyOutbound outbound, TcpMessageCodec<P> codec, reactor.core.publisher.Sinks.Empty<Void> completionSink) 
 
- 
- 
Method Details- 
sendAsyncDescription copied from interface:TcpConnectionSend the given message.- Specified by:
- sendAsyncin interface- TcpConnection<P>
- Parameters:
- message- the message
- Returns:
- a CompletableFuture that can be used to determine when and if the message was successfully sent
 
- 
onReadInactivityDescription copied from interface:TcpConnectionRegister a task to invoke after a period of read inactivity.- Specified by:
- onReadInactivityin interface- TcpConnection<P>
- Parameters:
- runnable- the task to invoke
- inactivityDuration- the amount of inactive time in milliseconds
 
- 
onWriteInactivityDescription copied from interface:TcpConnectionRegister a task to invoke after a period of write inactivity.- Specified by:
- onWriteInactivityin interface- TcpConnection<P>
- Parameters:
- runnable- the task to invoke
- inactivityDuration- the amount of inactive time in milliseconds
 
- 
closepublic void close()Description copied from interface:TcpConnectionClose the connection.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Specified by:
- closein interface- TcpConnection<P>
 
- 
toString
 
-