cURL / Mailing Lists / curl-library / Single Mail


Re: proposal for new curl_mutli_socket API

From: Daniel Stenberg <>
Date: Fri, 25 Apr 2008 09:48:39 +0200 (CEST)

On Thu, 24 Apr 2008, Christopher Palow wrote:

> I'd like to propose a new function for use when starting a new easy handle
> that has just been added to a multi handle.
> In the current API after adding an easy handle to a multi handle with
> curl_multi_add_handle() you then have to call curl_multi_socket_all() to
> start the this newly added easy handle. curl_multi_socket_all() is O(N) of
> the number of easy handles associated with the multi handle. When youčre
> adding an easy handle to a multi handle with thousands of connections this
> becomes a performance issue.
> What do you guys think? If you like it Ičll write up blurb for it in the
> man page too.

I think this is mostly based on some kind of misunderstanding and quite
possibly because not good enough documentation.

We did have this problem until I fixed it in a way that makes it possible for
you to simply add a handle, and then call the "normal" curl_multi_socket() and
the new handle will be detected and taken care of just fine.

Thus, when you're already "in the game" you don't need to do anything else
than just curl_multi_add_handle() when you add a new easy handle as the normal
loop will adopt the new kid into the family by itself.

  Commercial curl and libcurl Technical Support:
Received on 2008-04-25