Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default timeout of curl call using libcurl in c++

Tags:

c++

libcurl

My application(A) in c++ makes curl call to another machine to start another application(B). When curl call is made by A then it waits till B finishes it's job. So I just want to ask that what is the default timeout for application A or it is by default disables i.e infinite timeout ?

like image 469
user1755967 Avatar asked Dec 12 '12 08:12

user1755967


People also ask

What is the default curl timeout?

The default is 60 seconds.

How do I check my curl timeout?

Tell curl with -m / --max-time the maximum time, in seconds, that you allow the command line to spend before curl exits with a timeout error code (28). When the set time has elapsed, curl will exit no matter what is going on at that moment—including if it is transferring data. It really is the maximum time allowed.

What is the default curl timeout PHP?

CURLOPT_CONNECTTIMEOUT: Defaults to 300 seconds. CURLOPT_CONNECTTIMEOUT_MS: No default. CURLOPT_ACCEPTTIMEOUT_MS: Defaults to 60000 ms.

What is the use of Curlopt_timeout?

CURLOPT_TIMEOUT is a maximum amount of time in seconds to which the execution of individual cURL extension function calls will be limited. Note that the value for this setting should include the value for CURLOPT_CONNECTTIMEOUT.


1 Answers

From http://curl.haxx.se/libcurl/c/curl_easy_setopt.html

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.

.

CURLOPT_TIMEOUT

Pass a long as parameter containing the maximum time in seconds that you allow the libcurl transfer operation to take. Normally, name lookups can take a considerable time and limiting operations to less than a few minutes risk aborting perfectly normal operations. This option will cause curl to use the SIGALRM to enable time-outing system calls.

In unix-like systems, this might cause signals to be used unless CURLOPT_NOSIGNAL is set.

Default timeout is 0 (zero) which means it never times out.

like image 101
BoBTFish Avatar answered Nov 11 '22 17:11

BoBTFish