onClose

fun onClose(callback: suspend (String) -> Unit): SocketSession

Sets the callback function to be invoked when the WebSocket session is closed.

Return

The updated SocketSession instance.

Parameters

callback

A suspend function to handle the close event.