类 ReactorNettyTcpConnection<P>
- java.lang.Object
- org.springframework.messaging.tcp.reactor.ReactorNettyTcpConnection<P>
- 类型参数:
P- the type of payload for outbound messages
- 所有已实现的接口:
Closeable,AutoCloseable,TcpConnection<P>
public class ReactorNettyTcpConnection<P> extends Object implements TcpConnection<P>
Reactor Netty based implementation ofTcpConnection.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 ReactorNettyTcpConnection(reactor.netty.NettyInbound inbound, reactor.netty.NettyOutbound outbound, ReactorNettyCodec<P> codec, reactor.core.publisher.DirectProcessor<Void> closeProcessor)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidclose()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.ListenableFuture<Void>send(Message<P> message)Send the given message.
构造器详细资料
ReactorNettyTcpConnection
public ReactorNettyTcpConnection(reactor.netty.NettyInbound inbound, reactor.netty.NettyOutbound outbound, ReactorNettyCodec<P> codec, reactor.core.publisher.DirectProcessor<Void> closeProcessor)
方法详细资料
send
public ListenableFuture<Void> send(Message<P> message)
从接口复制的说明:TcpConnectionSend the given message.- 指定者:
send在接口中TcpConnection<P>- 参数:
message- the message- 返回:
- a ListenableFuture that can be used to determine when and if the message was successfully sent
onReadInactivity
public void onReadInactivity(Runnable runnable, long inactivityDuration)
从接口复制的说明:TcpConnectionRegister a task to invoke after a period of read inactivity.- 指定者:
onReadInactivity在接口中TcpConnection<P>- 参数:
runnable- the task to invokeinactivityDuration- the amount of inactive time in milliseconds
onWriteInactivity
public void onWriteInactivity(Runnable runnable, long inactivityDuration)
从接口复制的说明:TcpConnectionRegister a task to invoke after a period of write inactivity.- 指定者:
onWriteInactivity在接口中TcpConnection<P>- 参数:
runnable- the task to invokeinactivityDuration- the amount of inactive time in milliseconds
close
public void close()
从接口复制的说明:TcpConnectionClose the connection.- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Closeable- 指定者:
close在接口中TcpConnection<P>