original_string: public function send ()
      {
          if ($this->_sent) {
              throw new CAS_OutOfSequenceException(
                  'Request has already been sent cannot send again.'
              );
          }
          if (!count($this->_requests)) {
              throw new CAS_OutOfSequenceException(
                  'At least one request must be added via addRequest() before the multi-request can be sent.'
              );
          }
  
          $this->_sent = true;
  
          // Initialize our handles and configure all requests.
          $handles = array();
          $multiHandle = curl_multi_init();
          foreach ($this->_requests as $i => $request) {
              $handle = $request->initAndConfigure();
              curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
              $handles[$i] = $handle;
              curl_multi_add_handle($multiHandle, $handle);
          }
  
          // Execute the requests in parallel.
          do {
              curl_multi_exec($multiHandle, $running);
          } while ($running > 0);
  
          // Populate all of the responses or errors back into the request objects.
          foreach ($this->_requests as $i => $request) {
              $buf = curl_multi_getcontent($handles[$i]);
              $request->_storeResponseBody($buf);
              curl_multi_remove_handle($multiHandle, $handles[$i]);
              curl_close($handles[$i]);
          }
  
          curl_multi_close($multiHandle);
      }
code: public function send ()
      {
          if ($this->_sent) {
              throw new CAS_OutOfSequenceException(
                  'Request has already been sent cannot send again.'
              );
          }
          if (!count($this->_requests)) {
              throw new CAS_OutOfSequenceException(
                  'At least one request must be added via addRequest() before the multi-request can be sent.'
              );
          }
  
          $this->_sent = true;
  
          // Initialize our handles and configure all requests.
          $handles = array();
          $multiHandle = curl_multi_init();
          foreach ($this->_requests as $i => $request) {
              $handle = $request->initAndConfigure();
              curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
              $handles[$i] = $handle;
              curl_multi_add_handle($multiHandle, $handle);
          }
  
          // Execute the requests in parallel.
          do {
              curl_multi_exec($multiHandle, $running);
          } while ($running > 0);
  
          // Populate all of the responses or errors back into the request objects.
          foreach ($this->_requests as $i => $request) {
              $buf = curl_multi_getcontent($handles[$i]);
              $request->_storeResponseBody($buf);
              curl_multi_remove_handle($multiHandle, $handles[$i]);
              curl_close($handles[$i]);
          }
  
          curl_multi_close($multiHandle);
      }
code_tokens: public function send ( ) { if ( $ this -> _sent ) { throw new CAS_OutOfSequenceException ( 'Request has already been sent cannot send again.' ) ; } if ( ! count ( $ this -> _requests ) ) { throw new CAS_OutOfSequenceException ( 'At least one request must be added via addRequest() before the multi-request can be sent.' ) ; } $ this -> _sent = true ; // Initialize our handles and configure all requests. $ handles = array ( ) ; $ multiHandle = curl_multi_init ( ) ; foreach ( $ this -> _requests as $ i => $ request ) { $ handle = $ request -> initAndConfigure ( ) ; curl_setopt ( $ handle , CURLOPT_RETURNTRANSFER , true ) ; $ handles [ $ i ] = $ handle ; curl_multi_add_handle ( $ multiHandle , $ handle ) ; } // Execute the requests in parallel. do { curl_multi_exec ( $ multiHandle , $ running ) ; } while ( $ running > 0 ) ; // Populate all of the responses or errors back into the request objects. foreach ( $ this -> _requests as $ i => $ request ) { $ buf = curl_multi_getcontent ( $ handles [ $ i ] ) ; $ request -> _storeResponseBody ( $ buf ) ; curl_multi_remove_handle ( $ multiHandle , $ handles [ $ i ] ) ; curl_close ( $ handles [ $ i ] ) ; } curl_multi_close ( $ multiHandle ) ; }
docstring: Perform the request. After sending, all requests will have their
  responses poulated.
  
  @return bool TRUE on success, FALSE on failure.
  @throws CAS_OutOfSequenceException If called multiple times.
docstring_tokens: Perform the request . After sending all requests will have their responses poulated .