cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Doubt in CURLOPT_TIMEOUT and CURLOPT_NOSIGNAL

From: chirayu joshi <chirayu143_at_gmail.com>
Date: Tue, 22 Feb 2011 14:13:11 +0530

If i sent the request to webserver from client and i want to check
whether the webserver is working or not. Then CURLOPT_TIMEOUT and
CURLOPT_CONNECTTIMEOUT does not have any significance so as to check
whether webserver is working or not and if this is the case then which
is the method that will help me out to check whether webserver is
working or not.

Your's Truely
Chirayu Joshi

On Tue, Feb 22, 2011 at 1:47 PM, Dan Fandrich <dan_at_coneharvesters.com> wrote:
> 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
>

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