cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Shaul Eizikovich <Shaul_at_checkpoint.com>
Date: Wed, 18 Aug 2004 14:37:27 +0200

Just before going multithreaded.
Is it possible to put the next calls to curl_multi_perform() and select() in
the callback function?
I really dislike the idea of multithreading...

Thanks!

> -----Original Message-----
> From: curl-library-bounces_at_cool.haxx.se
> [mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of
> Daniel Stenberg
> Sent: Wednesday, August 18, 2004 1:22 PM
> To: libcurl development
> Subject: RE: Using libcurl for async operations: Cannot use
> callback write function
>
> On Wed, 18 Aug 2004, Shaul Eizikovich wrote:
>
> > Well, I want to return ASAP from this function, letting the
> transfer
> > work in the background. I probably miss something.
>
> I think you do miss one vital part:
>
> You need to keep calling curl_multi_perform() to make things
> get transferred.
> If you don't call it, nothing gets transferred. Every time
> you call it, a piece of the transfer is made (if there's
> anything to do at that time).
>
> The function returns CURLM_CALL_MULTI_PERFORM only if you
> should call it again before you do select(), but you should
> always keep calling it until the transfer is done. Preferably
> after waiting for action with select().
>
> If you want stuff to happen "in the background", you need to
> start a new thread and do the transfer there.
>
> --
> 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