Seems like I am missing something. Shouldn't one be able to specify a time out on an HTTPConnection attempt? By default Python socket has no timeout (out of curiosity anyone know the history of this choice as it seems so prone to create problems) so I would expect to see one on the client's of socket. Is my only option to set the default timeout in the sockets module?
httplib timeout specification
Collapse
X
-
Tags: None
-
No timeouts in python sockets ??Originally posted by Benny the GuardSeems like I am missing something. Shouldn't one be able to specify a time out on an HTTPConnection attempt? By default Python socket has no timeout (out of curiosity anyone know the history of this choice as it seems so prone to create problems) so I would expect to see one on the client's of socket. Is my only option to set the default timeout in the sockets module?
[CODE=python]import socket
sock=socket.soc ket()
sock.settimeout (8.2)[/CODE] -
I know there are timeouts in sockets, but I want them in HTTPConnection objects. Either I need to import sockets and change the timeout for all sockets (which may be undesirable) or leave it at no timeout for an HTTP connection. The side question was, is there a valid/useful reason the default timeout for sockets is None thus causing potential locks in every python program.Comment
Comment