cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Using libcurl for async operations: Cannot use callback write function

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 18 Aug 2004 14:08:27 +0200 (CEST)

On Wed, 18 Aug 2004, Shaul Eizikovich wrote:

> Is it possible to put the next calls to curl_multi_perform() and select() in
> the callback function?

1. It would make it terribly recursive

2. Then you'd get a synchronous transfer and if that's OK, you can just as
    well use the easy interface.

3. Sometimes you need to call the function without having had the write
    callback called, and calling it from within the write function would be
    pointless many times since there may not be more data to take care of at
    that moment.

Summary: bad idea. ;-)

> I really dislike the idea of multithreading...

You can avoid multithreading, but then you need to adapt your program slightly
to how the multi interface works.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-08-18