接口 TcpOperations<P>
- 类型参数:
P
- the type of payload for in and outbound messages
- 所有已知实现类:
ReactorNettyTcpClient
public interface TcpOperations<P>
A contract for establishing TCP connections.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 ListenableFuture<Void>
connect(TcpConnectionHandler<P> connectionHandler)
Open a new connection.ListenableFuture<Void>
connect(TcpConnectionHandler<P> connectionHandler, ReconnectStrategy reconnectStrategy)
Open a new connection and a strategy for reconnecting if the connection fails.ListenableFuture<Void>
shutdown()
Shut down and close any open connections.
方法详细资料
connect
ListenableFuture<Void> connect(TcpConnectionHandler<P> connectionHandler)
Open a new connection.- 参数:
connectionHandler
- a handler to manage the connection- 返回:
- a ListenableFuture that can be used to determine when and if the connection is successfully established
connect
ListenableFuture<Void> connect(TcpConnectionHandler<P> connectionHandler, ReconnectStrategy reconnectStrategy)
Open a new connection and a strategy for reconnecting if the connection fails.- 参数:
connectionHandler
- a handler to manage the connectionreconnectStrategy
- a strategy for reconnecting- 返回:
- a ListenableFuture that can be used to determine when and if the initial connection is successfully established
shutdown
ListenableFuture<Void> shutdown()
Shut down and close any open connections.- 返回:
- a ListenableFuture that can be used to determine when and if the connection is successfully closed