Interface ClientConnector.ConnectListener

All Superinterfaces:
EventListener
Enclosing class:
ClientConnector

public static interface ClientConnector.ConnectListener extends EventListener

A listener for events about SocketChannel.connect(SocketAddress).

The events are:

  • begin, just before the connect() call
  • success, when the connect() call succeeds
  • failure, when the connect() call fails
  • Method Details

    • onConnectBegin

      default void onConnectBegin(SocketChannel socketChannel, SocketAddress socketAddress)

      Callback method invoked just before a SocketChannel.connect(SocketAddress) call.

      Parameters:
      socketChannel - the local socket channel that is about to connect
      socketAddress - the remote socket address to connect to
    • onConnectSuccess

      default void onConnectSuccess(SocketChannel socketChannel)

      Callback method invoked when a SocketChannel.connect(SocketAddress) call completes successfully.

      Parameters:
      socketChannel - the local socket channel that succeeded to connect to the remote socket address
    • onConnectFailure

      default void onConnectFailure(SocketChannel socketChannel, SocketAddress socketAddress, Throwable failure)

      Callback method invoked when a SocketChannel.connect(SocketAddress) call completes with a failure.

      Parameters:
      socketChannel - the local socket channel that failed to connect to the remote socket address
      socketAddress - the remote socket address to connect to
      failure - the failure cause