Socket Options (Cont) SO_LINGER - allows "lingering on close", that is, when the sending side of the socket is closed, the application will block until all data waiting to be sent in the local buffer - is transmitted. Reason: the OS wants to assure that close() returns quickly, so by default it dumps out any data waiting in the send buffer. Symptom: without SO_LINGER, last packets might be lost. This is relevant if you do not perform a 3-way handshake on connection close. Parameters: struct linger { int l_onoff; /* linger active. 1 - true. 0 - false. */ int l_linger;/* how long to linger for in seconds. */ };