On Tuesday, 11 November 2014 at 16:04:21 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 11 Nov 2014 15:35:28 +0000
RuZzz via Digitalmars-d-learn
<digitalmars-d-learn@puremagic.com> wrote:
netstat reports that the socket is in the TIME_WAIT or
CLOSE_WAIT state.
i'm not an expert in winsock, but did you tried to set
SO_LINGER to
"off"?
Closed ports stay in state WAIT for quite a while.
If SO_LINGER=off doesn't help try to tune some Windows TCP
parameters:
- reduce TcpTimedWaitDelay from 120 to 30 seconds
- use ports above 5000
- bigger port hash table
Remember to reboot after stetting these registry values:
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"TcpTimedWaitDelay"=dword:0000001e
"MaxUserPort"=dword:fffe
"MaxHashTableSize"=dword:ffff
"NumTcbTablePartitions"=dword:8