cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: working on a new API

From: Steve Dekorte <steve_at_dekorte.com>
Date: Mon, 29 Oct 2001 11:55:54 -0800

On Monday, October 29, 2001, at 04:23 AM, Daniel Stenberg wrote:

> On Sat, 27 Oct 2001, Steve Dekorte wrote:
>> I was thinking this middle bit would look like:
>>
>> {
>> while(curl_select_count(select_handle)!=0)
>> { curl_select_perform(select_handle); }
>> /* this way curl_select_extract isn't needed */
>> }
>
> Why busy-loop like that? If you want a "pull" interface it is generally
> because you wanna do other things as well while transfering data with
> curl.
> Then you'd probably do that with your own select().

I was just offering it as an example of the simplest code.
To be more clear:

   ...application run loop...
   {
      ...other stuff...
      curl_select_perform(select_handle); // handle all curl handles with
waiting data without blocking
   }

> In fact, with my suggested interface we can use your approach as well.
> You
> just call the curl_select_perform() either when you know there's data
> on one
> of curl's file descriptors or when you think it would be good to let
> curl
> figure that out itself. curl_select_count() in your example gets the
> same
> information as the curl_select_extract() does in my example (only a
> little
> less detailed).

I don't see any reason to provide the info in curl_select_extract. The
only thing it's information is useful for is doing what
curl_select_perform() does for you. Or is there something I'm missing?

Steve
Received on 2001-10-29