Creates a connection.
Unique connection ID (from runtime.uuid())
The path the connection was opened on
The runtime-agnostic socket
The current monotonic timestamp (runtime.hrtime())
Whether this connection participates in the shared heartbeat sweep
Per-connection application state, the socket-lifetime analogue of IRequestContext.state. Use it to attach an authenticated user id, a tenant, or any value later handlers and broadcasts need.
Unique connection ID (from runtime.uuid()).
Whether the connection is still writable.
The monotonic timestamp of the most recent inbound frame. Compared against
another runtime.hrtime() reading — never against a wall clock.
Whether the shared heartbeat sweeper should include this connection.
When false, the sweeper skips both the payload send and idle eviction.
The path this connection was opened on.
Current lifecycle state.
Closes the connection. Idempotent.
Optionalcode: number
RFC 6455 close code (defaults to 1000)
Optionalreason: string
Human-readable close reason
Marks the connection closed without touching the transport — used when the peer closed first, so the socket is already gone.
Serializes a value to JSON and sends it as a text frame.
The payload type
The value to serialize
Records that a frame arrived, resetting the idle countdown.
The current monotonic timestamp (runtime.hrtime())
A live WebSocket connection.
Tracks the monotonic timestamp of the last inbound frame so the heartbeat sweeper can find idle peers, and refuses writes once closed rather than failing deep inside a platform socket.
Since
0.1.0