WebSocketMessageHandler

An abstract class that you should extend to define logic for handling websocket messages and events. Create a new class that inherits from this one, and overrides any "on..." methods that you'd like.

Members

Functions

onBinaryMessage
void onBinaryMessage(WebSocketBinaryMessage msg)

Called when a binary message is received.

onCloseMessage
void onCloseMessage(WebSocketCloseMessage msg)

Called when a CLOSE message is received. Note that this is called before the socket is necessarily guaranteed to be closed.

onConnectionClosed
void onConnectionClosed(WebSocketConnection conn)

Called when a websocket connection is closed.

onConnectionEstablished
void onConnectionEstablished(WebSocketConnection conn)

Called when a new websocket connection is established.

onTextMessage
void onTextMessage(WebSocketTextMessage msg)

Called when a text message is received.