close

suspend fun close(reason: String? = null): SocketSession

Closes the WebSocket session with an optional reason.

Return

The updated SocketSession instance.

Parameters

reason

The reason for closing the connection (default is null).