Home All Groups Group Topic Archive Search About

Reduce TIME_WAIT of Socket

Author
17 Feb 2006 1:43 PM
Zeeshan Gulzar
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

Author
17 Feb 2006 4:04 PM
Vadym Stetsyak
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
Author
18 Feb 2006 1:08 PM
Zeeshan Gulzar
Thank you very much Vadym Stetsyak,
Can you  please tell me what SocketOptionName.ReuseAddress actually does.

Show quote
"Vadym Stetsyak" wrote:

> 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
Author
18 Feb 2006 1:51 PM
Vadym Stetsyak
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

AddThis Social Bookmark Button