简体   繁体   English

CURLOPT_TIMEOUT 不适用于 curl_multi

[英]CURLOPT_TIMEOUT not working for curl_multi

The CURLOPT_TIMEOUT option doesn't seem to work when there are multiple handlers:当有多个处理程序时,CURLOPT_TIMEOUT 选项似乎不起作用:

I execute the handlers via this function:我通过这个 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); ).现在,当服务器关闭时,它会忽略CURLOPT_TIMEOUT并需要很长时间才能继续(它在第二次调用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在 libcurl 7.21.2之前,多接口不支持 CURLOPT_TIMEOUT

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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