-
- All Implemented Interfaces:
public class SocketListenerListener which is invoked for WebSocket events.
-
-
Constructor Summary
Constructors Constructor Description SocketListener()
-
Method Summary
Modifier and Type Method Description UnitonConnecting()Invoked when the connection begins to establish and socket state changes to Connecting. UnitonConnected(ConnectedEvent event)Invoked when we receive the first ConnectedEvent in this connection. UnitonDisconnected(DisconnectCause cause)Invoked when the web socket connection is disconnected. UnitonError(ChatError error)Invoked when there is any error in this web socket connection. UnitonEvent(ChatEvent event)Invoked when we receive any successful event. -
-
Method Detail
-
onConnecting
Unit onConnecting()
Invoked when the connection begins to establish and socket state changes to Connecting.
-
onConnected
Unit onConnected(ConnectedEvent event)
Invoked when we receive the first ConnectedEvent in this connection.
Note: This is not invoked when the ws connection is opened but when the ConnectedEvent is received.
- Parameters:
event- ConnectedEvent sent by server as first event once the connection is established.
-
onDisconnected
Unit onDisconnected(DisconnectCause cause)
Invoked when the web socket connection is disconnected.
- Parameters:
cause- DisconnectCause reason of disconnection.
-
onError
Unit onError(ChatError error)
Invoked when there is any error in this web socket connection.
- Parameters:
error- ChatError object with the error details.
-
-
-
-