#include <dolphin/socket.h>
typedef struct SOLinger
{
int onoff; // zero = off, nonzero = on
int linger; // linger time in seconds
} SOLinger;
SOLinger socket option controls the behavior of the
SOClose() function for the
SO_SOCK_STREAM (TCP) socket:
onoff = 0 (default) |
SOClose() returns as quickly as possible and all data is
transmitted in the background. |
onoff = 1 |
SOClose() returns immediately and the current connection is
aborted. |
onoff = 1 |
SOClose() blocks until all data is transmitted for up to
the specified linger time. |