half-open connection
A TCP connection that one side still thinks is open although the other side has gone away without closing it.
In more detail
Mobile devices that lose coverage or go to sleep leave half-open sockets behind. The server keeps holding memory and a file descriptor for each until a heartbeat notices there is no reply and closes it.
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.
- TCP — The internet protocol that delivers data between programs reliably and in order, used by the web and most databases.
- file descriptor — A small number the operating system gives a process for each open file, socket or pipe, used in every later read or write.
- 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.
Taught in
- Bidirectional WebSockets: Reconnection & Heartbeats — Production Full-Stack Engineering
- Native WebSockets: Bidirectional Real-Time Streams — Node.js Internals & Backend Services