类 Reactor2TcpConnection<P>
- java.lang.Object
- org.springframework.messaging.tcp.reactor.Reactor2TcpConnection<P>
- 类型参数:
P
- the payload type of messages read or written to the TCP stream.
- 所有已实现的接口:
Closeable
,AutoCloseable
,TcpConnection<P>
public class Reactor2TcpConnection<P> extends Object implements TcpConnection<P>
An implementation ofTcpConnection
based on the TCP client support of the Reactor project.- 从以下版本开始:
- 4.2
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
close()
Close the connection.void
onReadInactivity(Runnable runnable, long inactivityDuration)
Register a task to invoke after a period of read inactivity.void
onWriteInactivity(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.
方法详细资料
send
public ListenableFuture<Void> send(Message<P> message)
从接口复制的说明:TcpConnection
Send 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)
从接口复制的说明:TcpConnection
Register 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)
从接口复制的说明:TcpConnection
Register 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()
从接口复制的说明:TcpConnection
Close the connection.- 指定者:
close
在接口中AutoCloseable
- 指定者:
close
在接口中Closeable
- 指定者:
close
在接口中TcpConnection<P>