-
public abstract class WebSocketListener
-
-
Method Summary
Modifier and Type Method Description voidonOpen(WebSocket webSocket, MobonResponse mobonResponse)Invoked when a web socket has been accepted by the remote peer and may begin transmittingmessages. voidonMessage(WebSocket webSocket, String text)Invoked when a text (type {@code 0x1}) message has been received.voidonMessage(WebSocket webSocket, ByteString bytes)Invoked when a binary (type {@code 0x2}) message has been received.voidonClosing(WebSocket webSocket, int code, String reason)Invoked when the remote peer has indicated that no more incoming messages will betransmitted. voidonClosed(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. voidonFailure(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. -
-
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.
-
onMessage
void onMessage(WebSocket webSocket, ByteString bytes)
Invoked when a binary (type
{@code 0x2}) 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.
-
-
-
-