ken <ke*********@gmail.comwrote:
Can you please tell me what is the timeout value of httplib.HTTP?
i.e. how long python will wait for a response in the below code?
h = httplib.HTTP(self.url, 8080)
h.putrequest('GET', '/sample/?url=' + self.url)
h.endheaders()
HTTP per se does not define any timeout -- if self.url is correctly
resolved by DNS and accepts a TCP connection on port 8080, and then just
hangs forever, you'll be waiting. You can force timeouts yourself by
playing with socket.setdefaulttimeout(...) before you start the HTTP
interaction.
Alex