SO_LINGER
SO_LINGER controls close() behavior: shut down immediately with an RST, or wait for queued data to drain (with a timeout) before closing.
Purpose
It shapes close() semantics when you must either guarantee delivery before shutdown or release the connection at once.
Mechanism
With linger on plus a timeout, close() blocks until the data is sent or the timeout expires, after which an RST is sent. With linger off (the default), close() returns immediately and remaining data is sent in the background. An immediate RST is used for abnormal teardown.
Use cases
- Graceful connection shutdown
- Abrupt connection reset
- Server shutdown
Related tools
HTTP Status Codes
Reference table of common HTTP status codes (1xx-5xx) with names, categories, and descriptions. Free, private, and 100% client-side. TOOL
URL Parser
Parse a URL into its components: protocol, host, path, query, hash, port, username, and password. Free, private, and 100% client-side. TOOL