ServerMessageSession
Manages a client WebSocket session to a server.
The session lifecycle is decoupled from the server's: if the underlying WebSocket drops, send transparently reconnects against the still-running server. Callers that need to stop the session explicitly should call close.
Parameters
host
server hostname
port
server port to connect to
endpoint
WebSocket endpoint path segment (without leading slash)
Functions
Link copied to clipboard
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.
Link copied to clipboard
Sends a ServerMessage as a text frame, opening (or reopening) the session if needed.