ping and pong frames
WebSocket control frames for checking a connection is alive: one side sends a ping and the other must answer with a pong.
In more detail
Servers ping periodically and close connections that stop answering, which clears out half-open connections. Browsers answer pings automatically, so no page code is needed.
Related terms
- heartbeat — A small message sent at regular intervals on a long-lived connection to prove that both ends and the path between them are still alive.
- half-open connection — A TCP connection that one side still thinks is open although the other side has gone away without closing it.
- WebSocket — A protocol that turns an HTTP connection into a long-lived, two-way channel where client and server can each send messages at any time.
Taught in
- Native WebSockets: Bidirectional Real-Time Streams — Node.js Internals & Backend Services