cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Is there an easy way to share curl_easy handle with threads?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 4 Feb 2015 14:19:35 +0100 (CET)

On Wed, 4 Feb 2015, Sébastien Petitdemange wrote:

> I've tried to create a curl main loop in a separated thread which execute
> curl_multi_perform. On other thread I initialize requests with curl_easy
> function then I give the handle to the main thread loop. But this is not
> working,all curl_easy request never ends.

From this short description it sounds as if it should be working.

> Is there an easy way to share those curl_easy handle with the mainloop or
> should I also create the request in the same thread?

You don't really create a "request" when you create an easy handle, you just
make a handle and specify details for the coming transfer. It really doesn't
do anything on the network until you've added it to the multi handle and run
perform...

-- 
  / daniel.haxx.se

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