C# Source Code: Tip: Configuring the amount of time a TCP sockets stays in Time Wait state
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
C# Source Code
Tip: Configuring the amount of time a TCP sockets stays in Time Wait state
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Tuesday, October 18, 2005
Hits:
1747
Category:
Sockets/Internet/Remote Comms
Article:
When using TCP sockets you will may notice that the port goes into a TIME_WAIT state for a period of time, before closing. This prevents you reusing this port for a specified amount of time (unless you set the ReuseAddress property to true). The default is 240 seconds which on a busy server will limit the maximum connections to around 200/sec. Reducing the following registry key will increase the connection throughput. 1) Open your registry and find or create the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters key. 2) Create a new DWORD value, or modify the existing value, called "TcpTimedWaitDelay" and set it to a decimal value of between 30-300 (secs). Note, you may need to restart or log out of Windows for the change to take effect.
Terms and Conditions
Support this site
Download a trial version of the best FTP application on the internet