I am trying to use PHP CURL HTTP Pipelining to execute multiple requests over a single TCP connection. Applies to this page http://www.php.net/manual/en/function.curl-multi-setopt.php I enable pipleining for curl_multi_exec () by adding:
curl_multi_setopt ($ mh, CURLMOPT_PIPELINING, 1);
I donβt want to publish a large list of sources here, but you can easily view or check the full example from my github here https://github.com/anovikov1984/pipelining-example
To control TCP connections, I use the netstat -t -u -c command in another console session.
There are two scenarios in my repo that I mentioned above. One for Ruby and one for PHP. The Ruby version works as desired and opens only one TCP connection for 3 GET requests. But the PHP version of cURL opens as many TCP connections as the number of cURL processes passed to curl_multi_exec ().
What am I doing wrong?
source
share