cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 9 Feb 2005 16:46:00 +0100 (CET)

On Wed, 2 Feb 2005, Jamie Lokier wrote:

> A simple multi-socket app's main loop looks like:
>
> void * fdset = curl_fdset_init();
> if (fdset == NULL)
> report_error (...);
> curl_multi_init(args, fdset, curl_fdset_modify);
> while(still_things_to_do) {
> curl_multi_perform(args); /* do stuff and update fds */
> curl_fdset_wait(); /* wait on 10000 connections */
> }
> curl_fdset_destroy (fdset);
>
> As you can see, this is nice and simple.

> An app which uses a different event loop, e.g. Gnome's, will use
> alternatives to those curl_fdset_* functions.

This letting libcurl do the waiting is bit hard to accept for me.

What about applications that want to wait for actions on one or more of their
own file descriptors? You say they will use alternatives, but how would they
do that?

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2005-02-09