Interface IWebSocketConnectionHandler

  • All Known Implementing Classes:
    WebSocketConnectionHandler

    public interface IWebSocketConnectionHandler
    Session handler for WebSocket sessions.
    • Field Detail

      • CLOSE_NORMAL

        static final int CLOSE_NORMAL
        Connection was closed normally.
        See Also:
        Constant Field Values
      • CLOSE_CANNOT_CONNECT

        static final int CLOSE_CANNOT_CONNECT
        Connection could not be established in the first place.
        See Also:
        Constant Field Values
      • CLOSE_CONNECTION_LOST

        static final int CLOSE_CONNECTION_LOST
        A previously established connection was lost unexpected.
        See Also:
        Constant Field Values
      • CLOSE_PROTOCOL_ERROR

        static final int CLOSE_PROTOCOL_ERROR
        The connection was closed because a protocol violation occurred.
        See Also:
        Constant Field Values
      • CLOSE_INTERNAL_ERROR

        static final int CLOSE_INTERNAL_ERROR
        Internal error.
        See Also:
        Constant Field Values
      • CLOSE_SERVER_ERROR

        static final int CLOSE_SERVER_ERROR
        Server returned error while connecting
        See Also:
        Constant Field Values
      • CLOSE_RECONNECT

        static final int CLOSE_RECONNECT
        Server connection lost, scheduled reconnect
        See Also:
        Constant Field Values
    • Method Detail

      • onOpen

        void onOpen()
        Fired when the WebSockets connection has been established. After this happened, messages may be sent.
      • onClose

        void onClose​(int code,
                     java.lang.String reason)
        Fired when the WebSockets connection has deceased (or could not established in the first place).
        Parameters:
        code - Close code.
        reason - Close reason (human-readable).
      • onMessage

        void onMessage​(java.lang.String payload)
      • onMessage

        void onMessage​(byte[] payload,
                       boolean isBinary)
      • onPing

        void onPing()
      • onPing

        void onPing​(byte[] payload)
      • onPong

        void onPong()
      • onPong

        void onPong​(byte[] payload)