private function CurlMulti::executeHandles

Execute and select curl handles until there is activity

Parameters

bool $select Set to TRUE to select the file descriptors:

int $timeout Select timeout in seconds:

Return value

int Returns the number of active handles

1 call to CurlMulti::executeHandles()
CurlMulti::perform in drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php
Get the data from the multi handle

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php, line 431

Class

CurlMulti
Send { This implementation allows callers to send blocking requests that return back to the caller when their requests complete, regardless of whether or not previously sending requests in the curl_multi object have completed. The implementation…

Namespace

Guzzle\Http\Curl

Code

private function executeHandles($select = false, $timeout = 1) {
  $active = $selectResult = 0;
  do {
    if ($select) {
      $selectResult = curl_multi_select($this->multiHandle, $timeout);
    }
    if ($selectResult === 0) {
      do {
        $mrc = curl_multi_exec($this->multiHandle, $active);
      } while ($mrc == CURLM_CALL_MULTI_PERFORM);

      // Check the return value to ensure an error did not occur
      $this
        ->checkCurlResult($mrc);
    }

    // Poll once if not selecting, or poll until there are no handles with activity
  } while ($select && $active && $selectResult == 0);
  return $active;
}