The TIME_WAIT state for the closed socket is normal. Even your 'c' program should
have had sockets in the TIME_WAIT state after they where closed. Some links to
explanations of this:
http://support.microsoft.com/default...b;en-us;137984
"NOTE: It is normal to have a socket in the TIME_WAIT state for a long period of
time. The time is specified in RFC793 as twice the Maximum Segment Lifetime (MSL).
MSL is specified to be 2 minutes. So, a socket could be in a TIME_WAIT state for
as long as 4 minutes. Some systems implement different values (less than 2
minutes) for the MSL"
http://tangentsoft.net/wskfaq/articl...gging-tcp.html
"Problem: Netstat shows lots of sockets in the TIME_WAIT state. What's wrong?"
"Solution: Nothing's wrong. TIME_WAIT is absolutely normal. [clipped] Thus,
TIME_WAIT usually lasts 30-120 seconds"
On the other hand I'm not sure why your would die with 3k of socket outstanding.
That seems a little low although the max number is dependent on OS memory so it
varies from machine to machine.
There is a 'resuse address' option also for sockets but I'm not sure if that would
help.
Mike
--
POST BY:
http://www.dotNET.us - Need .NET? Just ask, Please dotNET.us