SocketListener

open class SocketListener

Listener which is invoked for WebSocket events.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open val deliverOnMainThread: Boolean = true

The callbacks are by default delivered on the main thread. Changing this property to false will deliver the callbacks on their originating threads.

Functions

Link copied to clipboard
open fun onConnected(event: ConnectedEvent)

Invoked when we receive the first ConnectedEvent in this connection.

Link copied to clipboard
open fun onConnecting()

Invoked when the connection begins to establish and socket state changes to Connecting.

Link copied to clipboard

Invoked when the web socket connection is disconnected.

Link copied to clipboard
open fun onError(error: Error)

Invoked when there is any error in this web socket connection.

Link copied to clipboard
open fun onEvent(event: ChatEvent)

Invoked when we receive any successful event.