cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Controlling curl_multi connection pool

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 2 Dec 2013 22:26:45 +0100 (CET)

On Mon, 2 Dec 2013, JT R wrote:

> I noticed that when I open 2-3 connections to the same domain, the multi
> interface pools them for reuse and distributes them on a "first come first
> serve" basis to each easy handle that needs to download from that domain.
> This means that any given easy handle will use whatever connection is
> available next in line to complete its request.

That's correct.

> I am trying to find a way to "bind" connections to easy handles, so that a
> given handle will always use the same connection for its requests.

But why? You'll just risk to get a reduced connection re-use but never get an
improved connection re-use ratio.

> Is this in any way possible?

No it isn't. We've always wanted to add that sharing ability to the share
interface but nobody has done that work (yet). You can of course help us
out...

> If it is not, is there at least a way to determine which connection is going
> to be used before submitting the easy handle to the multi interface?

No. It is a single pool and libcurl will try to find an unused that is
suitable.

-- 
  / daniel.haxx.se
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2013-12-02