Why do Windows sockets break after exactly 4 minutes?

Van Gale cgale1 at cox.net
Sat Mar 23 02:10:54 EST 2002


"Geoffrey Talvola" <gtalvola at nameconnector.com> wrote in message
news:mailman.1016825146.27883.python-list at python.org...
> Gordon McMillan wrote:
> >
> > Your client does a shutdown(1) after sending some data.
> > The shutdown(1) causes the server to fall out of the
> > receive loop. It then sleeps for however long specified,
> > sends some data and closes the socket.
> >
> > In other words, the behavior is exactly what you asked
> > for, and Windows' socket implementation has nothing to
> > do with it.

Geoff,

I'm a little late in this conversation so haven't read all the replies, and
I'm not really a Windows programmer (IANAWP?), but I'll try to contribute
anyway :)

I think Gordan is right, given the following information:

ftp://ftp.microsoft.com/bussys/sql/kb/q105/7/94.txt

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q149532

Do a "Find on this page" for MSL at
http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/itsolutio
ns/network/deploy/depovg/tcpip2k.asp

So, I'm guessing what's happening is the shutdown(1) is causing the server
to stop responding to keepalives after 4 minutes.  I can't say off the top
of my head whether or not this is buggy behaviour.

Try setting TcpTimedWaitDelay in the registry to 300 and see if the client
connection breaks at the 5 minute mark.  Don't forget the obligatory Windows
reboot!

If this isn't the problem I'll just place the blame on not having an NT/2k
box for testing before posting :)

--
Van Gale






More information about the Python-list mailing list