接口 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
    • 方法详细资料

      • connect

        ListenableFuture<Voidconnect​(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<Voidconnect​(TcpConnectionHandler<P> connectionHandler,
                                       ReconnectStrategy reconnectStrategy)
        Open a new connection and a strategy for reconnecting if the connection fails.
        参数:
        connectionHandler - a handler to manage the connection
        reconnectStrategy - a strategy for reconnecting
        返回:
        a ListenableFuture that can be used to determine when and if the initial connection is successfully established
      • shutdown

        ListenableFuture<Voidshutdown()
        Shut down and close any open connections.
        返回:
        a ListenableFuture that can be used to determine when and if the connection is successfully closed