cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Sébastien Petitdemange <sebastien.petitdemange_at_esrf.fr>
Date: Wed, 04 Feb 2015 17:18:24 +0100

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks a lot Daniel for your quick reply. You have right this work,
I've just had a problem in my code.

SEB

On 02/04/2015 02:19 PM, Daniel Stenberg wrote:
> 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...
>
>
>
> -------------------------------------------------------------------
>
>
List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJU0kZQAAoJEEtktDVosZgULR8IAKHxMRDyn2HYXwIfkv1p7cxG
qtkKWBnQZZ35NQSDuioVsL77az5no0sADDvKUuR205EGscUZG9jnSfc0BeudMED4
lmVbwik9mZJww90d3U90c6J0c7NtZkK/R11iQJBbkjCFZEotpE648rR4L7CRfH/3
gudLx9w0BqK1mq5ykA4RDjNFiuTjKacUV/LP4b7baOOr3QmqSkjFcQ7k7DRMKFz6
ZqAcM5xpgJwU8iVb4KI4a9f6c+wQWYNUwOsQ4xF4a0doaIqYo61ExfV2ZmQ7ffWa
TkFuPx34Ev64KmOj49nF6WGXN+YmGC9upau5vFPvTmdMorM9BDJz7k963jLDd08=
=E2N9
-----END PGP SIGNATURE-----

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2015-02-04