cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: multi API q

From: Ben Greear <greearb_at_candelatech.com>
Date: Tue, 27 Nov 2001 09:59:13 -0700

Daniel Stenberg wrote:

> On Tue, 27 Nov 2001, Ben Greear wrote:
>
>
>>Why don't you do something like:
>>
>>create HTTP handle
>>Add handle to multi-main-loop
>>create FTP handle
>>Add handle to multi-main-loop
>>add your own private handle to multi-main-loop
>>[you get callbacks as your handle has data available]
>>create HTTP handle
>>add handle to multi-main-loop
>>[ftp is done, it is removed, and you get a callback]
>>create FTP handle
>>add handle to multi-main-loop
>>
>
> Mainly because that wouldn't be a "pull" interface so it wouldn't fulfill my
> goals for this interface. "pull" as in the application decides when to read
> or write.

Ahh, ok. I think I was a bit confused. So, in this API the main-loop
(and FD-SETs) are in the user's code? If not, how does the app know when
it *can* write (it needs to have access to an fd_set and select() somehow.)

>
> Using my described approach, we could easily also support this scenario if we
> would want that.
>
> But, you do address one question of mine. So you think completed handles
> should be removed from the multi collection, to get added again if you want
> to make more transfers?

Yes. They should be returned to the app through a callback so the
app can make the appropriate decision. Otherwise I think you'll be
leaking file descriptors very easily!

Ben

>
>

-- 
Ben Greear <greearb_at_candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
Received on 2001-11-27