connect

suspend fun connect()

Connect to WebSocket server.

Flow:

  1. Open WebSocket connection

  2. Send connection_init

  3. Wait for connection_ack (with timeout)

  4. Start message processing loop

Throws

WebSocketException

if connection fails

TimeoutCancellationException

if connection_ack not received in time