Voting

: min(three, seven)?
(Example: nine)

The Note You're Voting On

Anonymous
11 years ago
In 5.3.9+, curl_multi_select always returns -1. If this is your case, just wait a bit and then proceed like nothing ever happened:
<?php
do {
$mrc = curl_multi_exec($multi, $active);
} while (
$mrc == CURLM_CALL_MULTI_PERFORM);

while (
$active && $mrc == CURLM_OK) {
//check for results and execute until everything is done

if (curl_multi_select($multi) == -1) {
//if it returns -1, wait a bit, but go forward anyways!
usleep(100);
}

//do something with the return values
while(($info = curl_multi_info_read($multi)) !== false){
if (
$info["result"] == CURLE_OK){
$content = curl_multi_getcontent($info["handle"]);
do_something($content);
}
}
do {
$mrc = curl_multi_exec($multi, $active);
} while (
$mrc == CURLM_CALL_MULTI_PERFORM);
}
?>

<< Back to user notes page

To Top