org.springframework.messaging.tcp

## Interface TcpConnectionHandler<P>

- Type Parameters:
    `P` - the type of payload for in and outbound messages

      public interface TcpConnectionHandler<P>

  A contract for managing lifecycle events for a TCP connection including the handling of incoming messages.
  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterConnected(TcpConnection<P> connection)` Invoked after a connection is successfully established.
    `void` | `afterConnectFailure(Throwable ex)` Invoked after a connection failure.
    `void` | `afterConnectionClosed()` Invoked after the connection is closed.
    `void` | `handleMessage(Message<P> message)` Handle a message received from the remote host.

- - ### Method Detail

    - #### afterConnected

          void afterConnected(TcpConnection<P> connection)

      Invoked after a connection is successfully established.
      Parameters:
        `connection` - the connection

    - #### afterConnectFailure

          void afterConnectFailure(Throwable ex)

      Invoked after a connection failure.
      Parameters:
        `ex` - the exception

    - #### handleMessage

          void handleMessage(Message<P> message)

      Handle a message received from the remote host.
      Parameters:
        `message` - the message

    - #### afterConnectionClosed

          void afterConnectionClosed()

      Invoked after the connection is closed.