cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_multi_fdset alternatives

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Thu, 8 Sep 2005 14:28:17 +0200 (CEST)

On Wed, 7 Sep 2005, Alexander Lazic wrote:

>> see around line 240 in include/curl/multi.h for the curl_multi_socket()
>> ideas.
>
> Looks very nice ;-) How can i help you to implement these idea?

You tell me where I find a few extra hours per day for a month or so!

If I'm very lucky, I get funded to do these changes later this year.

If not, we just have to do the changes a little bit at a time to end up with
something working in the end.

> CURLMcode curl_multi_socket(CURLM *multi_handle,
> curl_socket_t s,
> CURL *easy,
> curl_socket_callback callback,
> void *userp); /* passed to callback */
>
> do i understand this right that the 'app' make the
> socket()/fctl(..$NONBLOCK..) calls and curl_multi_init()/curl_easy_init()
> and then call the curl_multi_socket, right?

The socket() calls would be for the applications own use, right? They can be
created, used and waited for togather with the ones curl_multi_socket()
provides.

curl_multi_socket() calls the callback to inform the application about what
sockets it uses and what actions to wait for on them. It also calls the
callback when sockets are removed or if there's a change of action to wait
for.

The app should then wait for action on all sockets libcurl has told it about
(and of course its own set of file descriptors).

A main difference from today is that you'd tell curl_multi_socket() exactly
what socket that had action on it so that it wouldn't have to check all its
sockets for that but only work on the actual socket that needs attention.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-09-08