I'm trying to use PHP cURL HTTP Pipelining feature to perform multiple requests through single TCP connection. Refers to this page http://www.php.net/manual/en/function.curl-multi-setopt.php I'm enabling pipleining for curl_multi_exec() by adding:
curl_multi_setopt($mh, CURLMOPT_PIPELINING, 1);
I don't want to post a big source listing here, but you can easily view or checkout the full example from my github here https://github.com/anovikov1984/pipelining-example
For monitoring TCP connections I use 'netstat -t -u -c' command in another console session.
In my repo that I mentioned above there are two scripts. One for Ruby and one for PHP. The Ruby version works as wanted and opens only single TCP connection for 3 GET requests. But the PHP cURL version opens as many TCP connection as the number of cURL handles passed to curl_multi_exec() function.
What am i doing wrong?