I get something similiar on linux and not so much on windows. My WebServer code is also careful about closing connections and the listener on program exit. Trying to start up sometimes finds the socket still in use. Now I'm referring to creating a listeneer, I don't get to many issues on individual conntions but I suspect the issue is similiar as I just wait a bit and then I can create the listener socket. Sometimes the OS seems to shut it down immediately, other times it hangs on to it a bit after I've closed it. Either way, I just put a loop in there that tries a predetermined number of times with time delay per try at startup. The bottom line is now my server either comes up immediately, or hangs a bit to get that socket (usually on subsequent runs... where I shut my webserver down and restart it again, say after a recompile. But a fresh "first time run" never has an issue) .
Works great though - Synapse is pretty darn sweet I'd say. --Jason Sicnemelpor wrote: > Thanks, Lukas, it helped to understand better what happens. > > "Problem: Netstat shows lots of sockets in the TIME_WAIT state. What’s > wrong? > > Solution: Nothing’s wrong. TIME_WAIT is absolutely normal. If you go > through the state-transition diagram above, you see that every socket that > gets closed normally goes through this state after it’s closed. The > TIME_WAIT state is a safety mechanism, to catch stray packets for that > connection after the connection is "officially" closed. Since the maximum > time that such stray packets can exist is 2 times the "maximum segment > lifetime" (the time for a packet to go from your machine to the remote > peer and for the response to come back), the TIME_WAIT state lasts for 2 * > MSL. The only tricky bit is, there is no easy way to estimate MSL on the > fly, so stacks traditionally hard-code a value for it, from 15 to 60 > seconds. Thus, TIME_WAIT usually lasts 30-120 seconds. > " > My tests flooded the server with connections to see if is able do deal > with. In real applications (unless DoS) it will never happen. > > To my understanding, I'll need to live with this behavior... > > []s > Nelson > > > >>> My trouble is that on Linux each connection remains "open" (seen with >>> netstat -ta) for about 1 minute, and when I test the server with many >>> connections, the number of ports available runs out and the systems >>> stalls for a moment - until some connections are closed (or reach >>> some timeout). >>> >> Read this: http://tangentsoft.net/wskfaq/articles/debugging-tcp.html >> >> It can help you, I hope. >> >> >> >> > > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ synalist-public mailing list synalist-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/synalist-public