The device id used by this session.
Date.now() of the last WS activity on the state socket (any frame, ping or
pong), or 0 before the socket opens. Use this — not state-frame arrival —
to judge transport liveness: Ynison is legitimately silent while the player
is paused/idle, but the keep-alive ping/pong keeps this fresh.
Run the full handshake (redirect → state). The returned promise resolves when the session closes normally and rejects on a handshake/transport failure.
Timeout for the redirect frame. Defaults to 10000.
Close both sockets (best-effort, idempotent).
Register a listener invoked for each state frame. Returns an unsubscribe function.
Wait for the first state frame.
How long to wait.
The first YnisonState.
A single Ynison session: performs the redirect → state handshake, dispatches state frames to listeners and keeps the connection alive.
Remarks
Reconnection is not built in; callers drive it (see the realtime client).