onClose

fun onClose(block: suspend (String) -> Unit): SocketBuilder

Sets the callback to be invoked when the WebSocket connection is closed.

Return

The SocketBuilder instance for chaining.

Parameters

block

A suspend function that will be called upon connection closure.