cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Direct socket IO with libcurl?

From: Jamie Lokier <jamie_at_shareable.org>
Date: Thu, 19 Oct 2006 22:59:31 +0100

Daniel Stenberg wrote:
> >maybe having a "please wait" return code would be useful for both Read and
> >Write function, once the reader or the writer of the buffer is happy, it
> >would say "please go on".
> >
> >i'm just wondering: what function would we call for that? currently there
> >is no function to act on a transfer once started, no?
>
> Correct, we need to invent a way to tell libcurl that we're not interested
> in getting anymore (data) from a specific transfer, and of course be able
> to again enable the flow. This goes for transfers in either direction.

An alternative model is to do it like asynchronous I/O calls:

  1. The app sets its callback; this is equivalent to "async_read".
  2. The callback is called _once_ when there is data; this is completion.
  3. When the app is ready to receive more, it goes to step 1.
     It would do this immediately after step 2 to get the current behaviour.

-- Jamie
Received on 2006-10-20