One idea- You need to tune your TCP settings, not familiar with windows at all, but generally you want to make the TIME_WAIT
or CLOSE_WAIT
interval shorter so connections don't hang around as long. On a busy server, sockets stacking up on you in CLOSE_WAIT
get into the tens of thousands and consume resources needlessly... You can sniff the interface, winpcap etc, and see if a fin is being sent, a correct (non reset) close should look like this:
TCP: .... 0... = (No push)
TCP: .... .0.. = (No reset)
TCP: .... ..0. = (No SYN)
TCP: .... ...1 = FIN
You can trace or truss the application, for instance if it uses closesocket()
, make sure it's your getting an rc of 0, etc.