cURL / Mailing Lists / curl-library / Single Mail


Re: Connection Options

From: Monica Lau <>
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
"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

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

Thanks for your help and time.


Does libcurl use non-blocking socket system calls

--- Daniel Stenberg <> 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
> > 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 -- --
> Dedicated custom curl help for hire:

Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
Received on 2004-04-02