curl-library
Re: curl_easy_perform gives CURLE_COULDNT_RESOLVE_HOST error in multi thread environment
Date: Sat, 29 Nov 2014 03:03:36 +0530
On Sat, Nov 29, 2014 at 2:16 AM, Dan Fandrich <dan_at_coneharvesters.com>
wrote:
> On Fri, Nov 28, 2014 at 10:20:17PM +0530, Praveen Pvs wrote:
> > Can I use CURL in multi threaded application?
>
> Yes, but you need to read http://curl.haxx.se/libcurl/features.html#thread
> and
> the links from there. Running into problems under a multithreaded
> environment
> that don't show up in a single threaded one is a good clue that some
> recommendation there isn't being followed.
>
> >>> We are taking care of some of things mentioned in those links. We are
not sharing the curl handles across threads. Main thread and
waitForHostConnection
thread have their local handers. we are also setting CURLOPT_NOSIGNAL to 1
in our code:
/* Set the NO SIGNAL option, This option is very important to set in case of
multi-threaded applications like ours, because otherwise the libcurl uses
signal handling for the communication and that causes the threads to go
crazy and even crash.*/
curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1L);
Not sure what could be the problem here which is failing for me!!! Could
you please shed more light on this issue.
>>> Dan
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-11-28