What is PyCurl's default timeout

Well, I think the title of the question is very self-explanatory, so you probably don't need to read, but here it is:

I've been working with PyCurl for a while and I've always set my timeouts using

curlConnector = pycurl.Curl()
curlConnector.setopt(pycurl.CONNECTTIMEOUT, 30)

      

but I started wondering if this is the default timeout or how to find it and I haven't found a satisfactory answer yet. If I don't manually specify it, what is the default timeout? Whatever comes from socket ? (Just in case it is relevant, I am working on Ubuntu 12.04 and python2.7)

+3


source to share


1 answer


I downloaded PyCurl. There doc/

are several doc files in the tarball directory . One of them is doc/curlobject.html

which says setup

"Corresponds to curl_easy_setopt in libcurl". Following this link, you will be taken to http://curl.haxx.se/libcurl/c/curl_easy_setopt.html , which when searching for 'CONNECTTIMEOUT' says:

CURLOPT_CONNECTTIMEOUT

Pass a long. It should contain the maximum time in seconds that you allow the connection to the server to take. 
This only limits the connection phase, once it has connected, this option is of no more use. 
Set to zero to switch to the default built-in connection timeout - 300 seconds. 
See also the CURLOPT_TIMEOUT option.

      



So, I would say the default timeout is 300 seconds.

+4


source







All Articles