onConnect

fun onConnect(block: suspend SocketSession.() -> Unit): SocketBuilder

Sets the callback to be invoked when a WebSocket connection is established.

Return

The SocketBuilder instance for chaining.

Parameters

block

A suspend function that will be called upon connection.