onDisconnect

abstract fun onDisconnect(handler: suspend (String) -> Unit)

Register a handler for disconnection events. Called when the socket disconnects (either intentionally or due to error).

Parameters

handler

Suspend function called on disconnection with reason