WebSocket ping and heartbeat
A WebSocket heartbeat periodically checks whether the remote endpoint is still responsive using protocol-level ping and pong control frames. In this course, heartbeat monitoring helps the backend detect unresponsive mobile clients and clean up their connections instead of retaining inactive clients indefinitely.