Location:
in6_opt.h
class TSoTcpLingerOpt;
Parameter struct for KSoTcpLinger socket option. The following combinations are possible:
iOnOff == 0 : Close() call returns immediately, but TCP still tries to transmit the data remaining in its send buffers.
iOnOff == 1, iLinger == 0 : Close() returns immediately, and the TCP sender discards all data in its send buffers. TCP RST is sent to the other end. Note: the TCP sender avoids the TIME_WAIT state.
iOnOff == 1, iLinger > 0 : Close() call blocks until the data in TCP send buffers is succesfully transmitted and the connection is graciously terminated. If the sender cannot transmit all data before the linger time expires, the Close() call wakes up, but the stack continues towards terminating the connection as usual.
A similar structure is used in BSD Unix sockets, hence porting Unix apps using linger option should be straight forward.
Defined in TSoTcpLingerOpt
:
iLinger
, iOnOff
TInt iLinger;
Linger time in seconds.