src/Transport/Protocol/Http/Curl.php
protected function _initRequest($socket, $response)
    {
        $stream = $this->_classes['stream'];

        $curlOptions = $socket->options();
        $curlOptions[CURLOPT_INFILESIZE] = $socket->outgoing()->length();

        if (isset($curlOptions[CURLOPT_FILE])) {
            $response->body(fopen($curlOptions[CURLOPT_FILE], 'w+'));
        }
        $socket->incoming($response->stream());

        if (!$handle = curl_init()) {
            throw new ClientException('Unable to create a new cURL handle');
        }
        curl_setopt_array($handle, $curlOptions);
        return $handle;
    }
protected function _initRequest($socket, $response)
    {
        $stream = $this->_classes['stream'];

        $curlOptions = $socket->options();
        $curlOptions[CURLOPT_INFILESIZE] = $socket->outgoing()->length();

        if (isset($curlOptions[CURLOPT_FILE])) {
            $response->body(fopen($curlOptions[CURLOPT_FILE], 'w+'));
        }
        $socket->incoming($response->stream());

        if (!$handle = curl_init()) {
            throw new ClientException('Unable to create a new cURL handle');
        }
        curl_setopt_array($handle, $curlOptions);
        return $handle;
    }
protected function _initRequest ( $ socket , $ response ) { $ stream = $ this -> _classes [ 'stream' ] ; $ curlOptions = $ socket -> options ( ) ; $ curlOptions [ CURLOPT_INFILESIZE ] = $ socket -> outgoing ( ) -> length ( ) ; if ( isset ( $ curlOptions [ CURLOPT_FILE ] ) ) { $ response -> body ( fopen ( $ curlOptions [ CURLOPT_FILE ] , 'w+' ) ) ; } $ socket -> incoming ( $ response -> stream ( ) ) ; if ( ! $ handle = curl_init ( ) ) { throw new ClientException ( 'Unable to create a new cURL handle' ) ; } curl_setopt_array ( $ handle , $ curlOptions ) ; return $ handle ; }
Initialize a socket to be ready to send data.

@param integer $max The number of simultaneous allowed connections.
Initialize a socket to be ready to send data .