cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_perform + interrupt

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 10 Feb 2016 15:01:37 -0500

On 2/8/2016 7:21 AM, Jeroen Ooms wrote:
>> Another thing in your code, there's no curl_multi_wait, why?
> Where would I put this, and why? Do you have other suggestions to
> improve the code? I think this is a fairly common use case; perhaps a
> worked example of a non-blocking easy-perform would be a useful
> addition to the manual?

You'll want to avoid busy waiting when there's nothing to do. Go to
sleep for 100ms or something. You could wait and sleep like in example
multi-single.c, also see easy_transfer in lib/easy.c [2].

[1]: https://curl.haxx.se/libcurl/c/multi-single.html
[2]: https://github.com/curl/curl/blob/curl-7_47_1/lib/easy.c#L682

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-02-10