cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Connection Options

From: Monica Lau <mllau2004_at_yahoo.com>
Date: Fri, 2 Apr 2004 09:21:51 -0800 (PST)

Hi Daniel,

Thanks for your quick response! I understand that the
connect() socket system call uses the operating
system's default timeout value, so I don't need to set
the CURLOPT_CONNECTIONTIMEOUT. However, for the
"recv()" socket system call, I believe this system
call will block and wait for the response from the
server, so there is no OS default timeout for this,
right? If this is the case, how does libcurl
implement the "GET" request to the web server? If it
uses the underlying "recv()" system call, then we must
set the CURLOPT_TIMEOUT value to prevent blocking
behavior?

I'm trying to write an application that emulates a web
client, that sends these HTTP "GET" requests to a web
server. In case that the web server hangs in the
middle of a "recv()" transaction, I just want to make
sure that my application doesn't hang as well. So,
I'm just wondering if libcurl implements non-blocking
or blocking system calls and if I need to set the
CURLOPT_TIMEOUT value.

Thanks for your help and time.

Regards,
Monica

Does libcurl use non-blocking socket system calls

--- Daniel Stenberg <daniel-curl_at_haxx.se> wrote:
> On Thu, 1 Apr 2004, Monica Lau wrote:
>
> > I'm very new to the libcurl library, and I have
> some questions about the
> > timeout conection options. Does anyone know what
> the default timeout values
> > are for the CURLOPT_TIMEOUT and the
> CURLOPT_CONNECTTIMEOUT values? If no
> > timeout value is specified for the CURLOPT_TIMEOUT
> value, and let's say that
> > the web server hangs for some strange reason,
> would the "curl_easy_perform"
> > function block/hang waiting for a response from
> the web server?
>
> libcurl has no default timeouts for these. When you
> don't use them, you will
> be in the hands of your operating system's timeouts.
>
> --
> Daniel Stenberg -- http://curl.haxx.se --
> http://daniel.haxx.se
> Dedicated custom curl help for hire:
http://haxx.se/curl.html

__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/
Received on 2004-04-02