简体   繁体   中英

CURLOPT_TIMEOUT not working for curl_multi

The CURLOPT_TIMEOUT option doesn't seem to work when there are multiple handlers:

I execute the handlers via this function:

function ExecHandle(&$curlHandle)
{
$flag=null;
do {
curl_multi_exec($curlHandle,$flag);
} while ($flag > 0);
}

Now when a server's down, it ignores the CURLOPT_TIMEOUT and takes a really long time till it continues (it's stuck the second time it calls curl_multi_exec($curlHandle,$flag); ). Is there any way to make the timeout work? Or is there another way to remove the handler if it takes too long?

The multi interface didn't support CURLOPT_TIMEOUT until libcurl 7.21.2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM