| Store | Cart

Am I misusing socket.setdefaulttimeout here?

From: Dave Brueck <d...@pythonapocrypha.com>
Thu, 20 Mar 2003 14:26:48 -0800 (PST)
On Thu, 20 Mar 2003, Skip Montanaro wrote:

>     >> Turns out timeouts don't play well with files.>>     Dave> Can you elaborate on how they don't work right? I'm still using>     Dave> timeoutsocket.py for some stuff and was hoping to migrate away>     Dave> from that, but it of course works great with httplib, xmlrpclib,>     Dave> etc.>> I made that assumption based upon this paragraph from the 2.3 socket module> doc:>>     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!

Thanks,
-Dave

Recent Messages in this Thread
Skip Montanaro Mar 20, 2003 05:57 pm
Skip Montanaro Mar 20, 2003 06:35 pm
Dave Brueck Mar 20, 2003 08:43 pm
Skip Montanaro Mar 20, 2003 08:22 pm
Dave Brueck Mar 20, 2003 10:26 pm
Syver Enstad Mar 20, 2003 10:21 pm
Skip Montanaro Mar 20, 2003 10:37 pm
Syver Enstad Mar 20, 2003 11:26 pm
Jp Calderone Mar 20, 2003 06:54 pm
Messages in this thread