Am I misusing socket.setdefaulttimeout here?

Syver Enstad syver-en+usenet at online.no
Thu Mar 20 17:21:31 EST 2003


Dave Brueck <dave at pythonapocrypha.com> writes:

> > Timeout mode internally sets the socket in non-blocking mode.  The
> 
> > blocking and timeout modes are shared between file descriptors and
> 
> > socket objects that refer to the same network endpoint.  A
> consequence
> 
> > of this is that file objects returned by the makefile() method
> should
> 
> >     only be used when the socket is in blocking mode; in timeout or
> > non-blocking mode file operations that cannot be completed
> immediately
> 
> >     will fail.
> 
> Doh! That's a real shame - the only time I ever really needed timeouts
> was
> 
> with those higher-level modules. Oh well... thank goodness for
> timeoutsocket.py!

I was under the definite impression that timeoutsocket also worked by
putting the socket in blocking mode. And httplib doesn't use the file
interface to the socket library as far as I can remember. The point I
am trying to make here is that I don't see why things that worked with
timeoutsocker should stop working on the new socket with timeout mode.

I may of course be wrong.

-- 

Vennlig hilsen 

Syver Enstad




More information about the Python-list mailing list