[Python-Dev] Socket timeout patch

Guido van Rossum guido@python.org
Fri, 07 Jun 2002 16:14:37 -0400


> Looks like I have missed the war, folks!  I will work on the test 
> suite.  The orginal test_timeout.py is incomplete.  I actually had 
> problem when writing test case for accept(), using blocking() and 
> makefile().  Guido, you are right on the point, the test suite 
> should work without the timeout code as well.  If I've done that ...
> 
> As for the scope of the test suite, I would prefer to focus on socket 
> timeout test for now.  Though there will be overlapping test for socket 
> timeout test and socket test, we can always merge it later.

Thanks, Bernie!

> I now have Visual C++ version 6, but still limited to Windows and 
> Linux.  I think once we are done with this two platform, we can ask 
> people to run the test on other platform.

Good idea.

> But I agreed with Michael that using python select module put us on
> the safer side.

But it's too slow.

> [Guido]
> > - Should sock.settimeout(0.0) mean the same as sock.setblocking(0)?
> 
> > OTOH, a timeout of 0 behaves very similar to nonblocking mode --
> > similar enough that a program that uses setblocking(0) would 
> > probably also work when using settimeout(0).  I kind of like the 
> > idea of having only a single internal flag value, sock_timeout, 
> > rather than two (sock_timeout and sock_blocking).
> 
> Agree.

Hm, finally someone who agrees with me on this. ;-)

> Steve Holden and M.-A. Lemburg have spoken.

Can I expect a patch from you or Michael?

--Guido van Rossum (home page: http://www.python.org/~guido/)