Reduce TIME_WAIT of Socket

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please tell me how i can reduce TIME_WAIT from 240 sec (default) to 10 sec or
less. I am using Windows 2000/XP with C#.Net 1.1.

Is Linger option helps me ?

If this setting is in registry, please send me the full path. becasue i find
my registry and did'nt find it.

Thank you
 
Hello, Zeeshan!

ZG> Is Linger option helps me ?

ZG> If this setting is in registry, please send me the full path. becasue i
ZG> find my registry and did'nt find it.

IIRC you can try SocketOptionName.ReuseAddress...
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
Thank you very much Vadym Stetsyak,
Can you please tell me what SocketOptionName.ReuseAddress actually does.
 
Hello, Zeeshan!

As the doc says "ReuseAddress : Allows the socket to be bound to an address that is already in use.".
It means that you can bind the socket to the address that is already used by another socket. ( that is why it can help with TIME_WAIT situations )

However, you should be cautios about using this option. Because this can inroduce problems when your sever has multiple IPs. The best solution here is to bind sockets to specific IPs and to use IpAddress.Any.
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
Back
Top