Curl CONNECTTIMEOUT question
If you curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 15); and 15 seconds passes and no connection is made, 开发者_开发技巧what will happen?
According to this mailing list thread, the documentation for curl_easy_setopt
and the documentation for curl_easy_perform
, the call to curl_easy_perform
will fail with error code CURLE_OPERATION_TIMEOUTED
as defined in <curl/curl.h>
.
I'd also recommend that you pass a long instead of an int. (They aren't always the same size, and curl_easy_setopt expects a long.
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 15L);
精彩评论