httplib timeout specification

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Benny the Guard
    New Member
    • Jun 2007
    • 92

    #1

    httplib timeout specification

    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?
  • Subsciber123
    New Member
    • Nov 2006
    • 87

    #2
    Originally posted by Benny the Guard
    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?
    No timeouts in python sockets ??
    [CODE=python]import socket
    sock=socket.soc ket()
    sock.settimeout (8.2)[/CODE]

    Comment

    • Benny the Guard
      New Member
      • Jun 2007
      • 92

      #3
      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

      Working...