cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Doubt in CURLOPT_TIMEOUT and CURLOPT_NOSIGNAL

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 22 Feb 2011 00:17:07 -0800

On Tue, Feb 22, 2011 at 11:54:32AM +0530, chirayu joshi wrote:
> i am using CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT in my
> implementation like this:
>
> check = curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1);
> or
> check=curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 1);

Note that these must be long integers; use 1L instead of plain 1 for a
1 second timeout (which seems pretty short, but it's valid).

> but when i am checking the value of "check" this variable always show
> me "0" whether the other end webserver is spawned or
> not..............(actually if other webserver is not spawned it should
> not return non-zero value).

The return code of curl_easy_setopt is an indication of whether the value
was set correctly. In current versions of libcurl, setting these timeouts
will ALWAYS return 0 (a.k.a. CURLE_OK).

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-22