Package 

Class WebSocketListener

    • Method Summary

      Modifier and Type Method Description
      void onOpen(WebSocket webSocket, MobonResponse mobonResponse) Invoked when a web socket has been accepted by the remote peer and may begin transmittingmessages.
      void onMessage(WebSocket webSocket, String text) Invoked when a text (type {@code 0x1}) message has been received.
      void onMessage(WebSocket webSocket, ByteString bytes) Invoked when a binary (type {@code 0x2}) message has been received.
      void onClosing(WebSocket webSocket, int code, String reason) Invoked when the remote peer has indicated that no more incoming messages will betransmitted.
      void onClosed(WebSocket webSocket, int code, String reason) Invoked when both peers have indicated that no more messages will be transmitted and theconnection has been successfully released.
      void onFailure(WebSocket webSocket, Throwable t, @Nullable() MobonResponse mobonResponse) Invoked when a web socket has been closed due to an error reading from or writing to thenetwork.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • onOpen

         void onOpen(WebSocket webSocket, MobonResponse mobonResponse)

        Invoked when a web socket has been accepted by the remote peer and may begin transmittingmessages.

      • onMessage

         void onMessage(WebSocket webSocket, String text)

        Invoked when a text (type {@code 0x1}) message has been received.

      • onClosing

         void onClosing(WebSocket webSocket, int code, String reason)

        Invoked when the remote peer has indicated that no more incoming messages will betransmitted.

      • onClosed

         void onClosed(WebSocket webSocket, int code, String reason)

        Invoked when both peers have indicated that no more messages will be transmitted and theconnection has been successfully released. No further calls to this listener will be made.

      • onFailure

         void onFailure(WebSocket webSocket, Throwable t, @Nullable() MobonResponse mobonResponse)

        Invoked when a web socket has been closed due to an error reading from or writing to thenetwork. Both outgoing and incoming messages may have been lost. No further calls to thislistener will be made.