cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Hello!

From: Ben Greear <greearb_at_candelatech.com>
Date: Thu, 25 Oct 2001 23:45:57 -0700

Daniel Stenberg wrote:

> > One of the things I want to support is rate-limitation. In other words,
> > I want to be able to specify (and change at any time) the rate in which
> > CURL sends or receives bytes. It would also be nice to have the CURL
> > libraries be non-blocking (use select), but that isn't a hard
> > requirement...
>
> Well, if you don't want full speed, your custom callbacks can just delay the
> operation as much as you want. I don't think we need to add any particular
> support for this internally. Or can you explain why we do?

Yeah, I kind of realized that a bit after I wrote the email...

If it's a feature that other folks would want, it might make sense
to add it into the library, but I doubt many people will want it...

> The library is already using select() in the transfer loop, but that might
> not be exactly what you was referring to? See also Steve Dekorte's suggested
> new API for more advanced select() trickery.

Well, I'm writing a server...it has at least one management connection (descriptor)
at then there's whatever is hiding in curl. Normally, I put the data fd's
and the management fd in the same select loop so that if no data is incoming
I can still get management data in... If curl has it's own loop (and I'm
single threaded), then I block my management connection on the data connections...

I think I'm going to be able to mimic that same behaviour by checking
my management descriptor on the progress callbacks (or the read/write
callbacks if necessary)...

Another thing we could do is poke FDs and timeout into curl's loop and
have it give callbacks when one of the external FD's is selected... To keep
curl's loop spinning freely, can use non-blocking IO. The user can specify
the maximum select timeout, so the user can be sure that they will be called
on a regular basis...

Anyway, the current scheme is good enough to get me started...and perhaps
I'll see an easier way to do what I want when I understand the library
better...

Thanks,
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-10-26