cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: a curl_multi_fdset() replacement? (TODO-RELEASE #55)

From: Jamie Lokier <jamie_at_shareable.org>
Date: Fri, 11 Feb 2005 19:17:01 +0000

Daniel Stenberg wrote:
> I take it the 4 functions you described:
>
> fdset_init - initialise the app-private fdset data structure
> fdset_modify - register or change interest in a single fd
> fdset_wait - call select() or poll() or something_else()
> fdset_destroy - destroy the app-private fdset data structure
>
> ... are functions that libcurl provides an implementation for but that an
> application can override?

It's not necessary for libcurl to provide them at all, but yes
that would work.

> Then we need a function that the app can call to set callbacks to its
> provided versions of these.

No, only one of them is a callback.

The app is responsible for calling fdset_init, fdset_wait and
fdset_destroy directly itself.

(In fact an app using its own functions might not even define those as
functions. They may just be a few lines of code in the app's event loop.)

The only function called by libcurl is fdset_modify.

In the example loops I suggested a way that could be specified to libcurl:

     curl_multi_init(args, fdset, fdset_modify);

> As a next step, I'll try to write jot down some notes about all these
> functions and how they should work and post them here. Then we should be
> able to smoothen out details and continue forwards on this work.
>
> Any objections?

None at all.

While you're jotting down notes, I forgot to mention that some way of
specifying a timeout is needed as well.

-- Jamie
Received on 2005-02-11