cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Ben Greear <greearb_at_candelatech.com>
Date: Mon, 31 Jan 2005 10:49:36 -0800

Daniel Haude wrote:
> Daniel Stenberg wrote:
>
>> In order to completely get rid of the FD_SETSIZE related problems from
>> libcurl, we need to provide a function in the multi interface that
>> exports a set of file descriptors (sockets) that an application should
>> wait for actions on. It would then not force the app to use select(),
>> but poll() or other available functions can be used instead.
>
>
> It's funny that this message arrives just now that I'm literally on the
> brink of embarking on my first libcurl project that was going to use
> multiple handles and select(). I've never used select() and have spent
> some time reading up on it -- I think I've got the concept now.
>
> My app was going to use several libcurl handles and one socket of an
> incoming connection from a client program. My idea was to pack all that
> into a big loop around a single select() call. Whenever select()
> returns, I'd check if the data came from some libcurl handle or from the
> other socket, then do with it whatever had to be done, and then sit on
> select() again.

This will work just fine for the vast majority of applications, especially
on Linux where select handles 1024 sockets by default.

Ben

-- 
Ben Greear <greearb_at_candelatech.com>
Candela Technologies Inc  http://www.candelatech.com
Received on 2005-01-31