Why heartbeat
Middleboxes drop idle TCP sessions; periodic ping keeps the channel warm and surfaces disconnects early.
Glossary
Without heartbeats, long-lived sockets die silently until the next send fails.
Middleboxes drop idle TCP sessions; periodic ping keeps the channel warm and surfaces disconnects early.
On read timeout, send ping or close; reset timers after pong.
After reconnect, re-send subscribe — servers do not remember prior symbol lists.
Heartbeat timeout should enter reconnect—not hang silently; always resubscribe after reconnect.
See reconnect guide and WS debugger.