WebSocket connection process for the Longbridge protocol.
Manages a WebSocket connection to a Longbridge endpoint, handling handshake, auth, heartbeat, request/response pairing, and push dispatch.
Wire-format details:
- Each protocol packet is wrapped as a 32-bit-big-endian length prefix plus payload and sent as a single WebSocket binary message.
- A single WebSocket binary message may contain multiple length-prefixed packets concatenated together; this module splits them on receive.
Handshake
WebSocket handshake is sent via URL query parameters
(?version=1&codec=1&platform=9) per the Longbridge spec, rather
than the 2-byte binary handshake used by TCP connections.
Summary
Functions
See Longbridge.Connection.Session.broadcast/2.
See Longbridge.Connection.Session.cancel_idle_timer/1.
See Longbridge.Connection.Session.cancel_reconnect_timer/1.
Returns a specification to start this module under a supervisor.
See Longbridge.Connection.Session.fail_pending_requests/2.
See Longbridge.Connection.Session.next_request_id/1.
See Longbridge.Connection.Session.schedule_idle_timer/1.
See Longbridge.Connection.Session.schedule_reconnect/2.
Functions
See Longbridge.Connection.Session.broadcast/2.
See Longbridge.Connection.Session.cancel_idle_timer/1.
See Longbridge.Connection.Session.cancel_reconnect_timer/1.
Returns a specification to start this module under a supervisor.
See Supervisor.
See Longbridge.Connection.Session.fail_pending_requests/2.
See Longbridge.Connection.Session.next_request_id/1.
See Longbridge.Connection.Session.schedule_idle_timer/1.
See Longbridge.Connection.Session.schedule_reconnect/2.