Reconnecting
The server sends a WebSocket ping frame every 15 seconds and closes the connection when it has received no pong for more than 31 seconds. Most WebSocket libraries answer pings automatically. The feed has no heartbeat message of its own.
Tickers are pushed about every 750 ms, even when nothing has changed, so if a subscribed ticker channel is silent for more than 5 seconds, reconnect.
After any reconnect you must:
- Re-send
114if you need private messages - authentication does not survive a reconnect. - Re-send every
151subscription - subscriptions are per-connection and are dropped when the socket closes. - Discard any locally-maintained order book and rebuild it from the snapshot that follows your
orderbookjoin.
Events that occurred while you were disconnected are not replayed. After reconnecting, read Open Orders and balances over REST, and reconcile against All Orders, Get User Trade Transactions and Get Account Balance - before trusting your local state.