cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Multithreaded use of libcurl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 17 Sep 2015 16:24:50 +0200 (CEST)

On Tue, 15 Sep 2015, doa379 wrote:

> I'm trying to use libcurl in a distinct pthread but the process gets stuck
> in the callback function as the url works like a socket and is constantly
> giving out data:
>
> curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, callbackFunc);

Why would it get stuck because of that?

> I would to implement a thread which allows to fork the libcurl process
> whilst other threads are still running. Even if the url doesn't finish
> giving out data.
>
> What's the best way to implement this?

Start a new thread/process and call the libcurl functions in there?

> Is there a better way to implement this other than making discrete and
> manual connections to the url?

I don't understand. Are you using curl_easy_perform() to do the transfers?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-09-17