Skip to content

WebSocket / Realtime Errors

Use WebSocket updates to keep order and market state fresh. If the stream disconnects or misses updates, reconnect and confirm critical order state through REST.

24 documented errors

WebSocket Error Lookup

Search reconnect, subscription, callback, queue, decode, and realtime stream errors.

Common Events

Event Action
Heartbeat missed Mark stream unhealthy and reconnect.
Connection dropped Reconnect with backoff and re-subscribe.
Subscription rejected Reduce stream weight or symbol count.
Decode/callback error Keep socket alive; isolate callback failure.
Order update gap Poll REST orderbook to fill state gap.
Token expired while connected Refresh token and reconnect.

Reconnect Flow

Disconnect detected
      |
      v
Close old socket
      |
      v
Refresh token if needed
      |
      v
Reconnect with backoff
      |
      v
Re-subscribe to saved subscriptions
      |
      v
Verify order and market data updates resume

Implementation Notes

  • Keep subscription state in memory.
  • Handle callback exceptions so one bad message does not stop the socket loop.
  • Use bounded reconnect attempts.
  • Reduce subscriptions if stream weight is exceeded.
  • Poll REST state after reconnect if order updates may have been missed.
NEO Assistant