TCP/IP timewaitstate will not remain in 2*MSL because of scavenging.
This happens even after applying the patch mentioned in:
Under sufficiently high TCP connection rates the Windows NT TCP/IP stack may reuse
TCP Control Blocks that are in the TIME-WAIT (also called the 2MSL state) table.
This can happen on a heavily loaded Web or FTP server when using graceful TCP closes.
Reuse of the Control Blocks may terminate a TCP connection in its TIME-WAIT state
prior to the 2MSL time period expiring.
There have been no reports of problems related to this symptom; however
the behavior is not RFC-compliant.
This behavior can occur because computers that run Microsoft Windows NT clients
and use excessive numbers of ports (more than 3,976 simultaneously) may run out of
ports before TCP/IP releases closed connections. The TCP/IP-state computer
dictates that when a connection is closed, the connection is not released until
two maximum segment lives (MSLs) have passed. This state is defined as the
Time-wait state. Since one MSL is defined as 120 seconds, it takes four minutes
for a closed connection to be released in TCP/IP.
NOTE: For more information on MSL and Time-wait,
please refer to Internet RFC 793.
The SO_LINGER option controls the action taken when unsent data is queued on a socket and a closesocket is performed. See closesocket for a description of the way in which the SO_LINGER settings affect the semantics of closesocket. The application sets the desired behavior by creating a LINGER structure (pointed to by the optval parameter) with these members l_onoff and l_linger set appropriately.