disconnect

fun disconnect(topic: String?, userInitiated: Boolean = false)

Disconnects the WebSocket client, optionally specifying whether the disconnection was user-initiated.

Parameters

topic

The WebSocket topic associated with the session.

userInitiated

Whether the disconnect was initiated by the user (default: false).