cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [Fwd: canceling a load in progress]

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 25 Oct 2001 20:42:35 +0200 (MET DST)

On Thu, 25 Oct 2001, Steve Dekorte wrote:

> How about an API like:
>
> curl_select_init(select_handle);

Shouldn't it return the handle?

> curl_select_add_handle(select_handle, curl_handle) // instead of calling
> perform

I like this! Add up "any amount" of curl handles. This gets even better if
done while a few handles are already transferring data...

> curl_select_remove_handle(select_handle, curl_handle)

Seems easy enough before the curl_select_perform() call, it might get tricky
if there's a transfer in progress already...

> curl_select_callback(select_handle, function, void*) // tells user about
> new data

Callbacks should also get the 'select_handle' passed to them so that they
dynamically can add call curl_select_add_handle()!

> curl_select_readsize(select_handle, int)
> curl_select_writesize(select_handle, int)

What are they supposed to do?

> curl_select_perform(select_handle) // calls select and processes io,
> non-blocking

> curl_select_cleanup(select_handle)

I like this API. It would add support for doing multiple file transfers in
the same thread in a portable and pretty slick way. It still doesn't really
take way the itch for the "Advanced API" as discussed before though, as that
would be a "pull" interface and this is still use the "push"-style...

Do we have other comments on this?

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-10-25