Class WebSocketListener

    • Constructor Detail

      • WebSocketListener

        public WebSocketListener()
    • Method Detail

      • onBeforeAccept

        public void onBeforeAccept​(WebSocket webSocket,
                                   Response response)
        Invoked before the web socket is accepted and the handshake is complete
      • onOpen

        public void onOpen​(WebSocket webSocket,
                           Response response)
        Invoked when a web socket has been accepted by the remote peer and may begin transmitting messages.
      • onMessage

        public void onMessage​(WebSocket webSocket,
                              byte[] bytes)
      • onClosing

        public void onClosing​(WebSocket webSocket,
                              int code,
                              String reason)
        Invoked when the remote peer has indicated that no more incoming messages will be transmitted.
      • onClosed

        public void onClosed​(WebSocket webSocket,
                             int code,
                             String reason)
        Invoked when both peers have indicated that no more messages will be transmitted and the connection has been successfully released. No further calls to this listener will be made.
      • onFailure

        public void onFailure​(WebSocket webSocket,
                              Throwable error,
                              Response response)
        Invoked when a web socket has been closed due to an error reading from or writing to the network. Both outgoing and incoming messages may have been lost. No further calls to this listener will be made.