cURL / Mailing Lists / curl-library / Single Mail


Re: questions regarding libcurl's multi interface

From: Jonathon <>
Date: Wed, 19 Oct 2011 17:41:48 -0700

Thanks Daniel for the help.

For #2, that's a good question. I'd like to have my client only
initiate one HTTP connection with the server at all times, but able to
submit several posts on that connection. After reading your previous
comments, I am guessing that I probably only need one easy-handle for
that and should use the HTTP pipelining functionality you referred to.

For #3, once I've submitted all my posts to the server, I'd like to
keep that connection open so that I can immediately send more posts in
the future without setting up the connection again. Is there a way to
do this? (i.e. specify "keep-alive" in the HTTP header).


On Wed, Oct 19, 2011 at 3:25 PM, Daniel Stenberg <> wrote:
> On Wed, 19 Oct 2011, Jonathon wrote:
>> it looks like the multi interface model simply executes several
>> easy-handles in parallel.
> correct
>> 1) Will the multi interface model *always* initiate one connection per
>> easy handle?  Meaning, if all my easy handles need to make a connection to
>> the same server (same exact URL), will it initiate a new connection for each
>> one?
> Yes, one connection for each easy handle you add to the multi handle, unless
> you enable pipelining.
>> 2) Is there a way to use the multi interface with several easy handles,
>> but have them all share the same connection?
> With HTTP that would only be possible with HTTP pipelining so you'd need to
> enable that. The question seems a bit strange though. Why would you add a
> lot of handles and have them use the same connection?
>> 3) How would I use the multi interface to keep the connections for my easy
>> handles alive?
> I'm afraid I don't understand the question. In what way would the multi
> interface affect how your connections are alive or not?
> --
>  /
> -------------------------------------------------------------------
> List admin:
> Etiquette:

List admin:
Received on 2011-10-20