init
Opens the WebSocket session (if not already open) and invokes onReady once the connection is established. Then blocks until the session is closed, so callers that rely on this method to keep their thread alive (e.g. the standalone server command) continue to work.
The session field is intentionally not cleared on exit: the server is on its own lifecycle and may still be running, so a later send should be able to reconnect rather than fail or trigger a server restart.