cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_CONNECTTIMEOUT and

From: Jerry G. Chiuan <jerry_at_oridus.com>
Date: Mon, 26 Jan 2004 09:38:53 -0800

> Subject: Re: CURLOPT_CONNECTTIMEOUT and
> CURLOPT_TIMEOUT sets a timeout for the entire transfer, so if the transfer
> is still in progress when the timer times out, the the transfer is
aborted.

Daniel,
first, thanks for your helpful explanation

what you mean by *entire* transfer, it includes connect, read/write, and
close,
right?

> With CURLOPT_NOSIGNAL set non-zero, curl will not use any signals and thus
> it won't abort functions using alarm() or similar.
>
> > If not, how does curl enable it?
>
> It doesn't, so if you want full and fine-grained time-out support you
should
> build curl to use ares for name lookups. The name lookup is the only
function
> call that isn't performed in a non-blockning manner by a default-build
curl.

So without using signal/alarm( ), curl timeout options *still* relies on
system calls, right?
So, never worry about clean-up underlying : ) that is great !

but, I am still courious how curl enables timeout without using signal?,
e.g. for UNIX multi-threaded program, using select( )?

> > Q2:
> > basically, there are 2 cases we need to take care of timeout for:
> > (1) try to "connect" to an invalid IP
> > (2) try to "connect" to a valid IP but there is no http server running
on it
>>
> In what way is the IP "invalid" ? If that is a slow name lookup happening,
> then there's the limits as explained above.

invalid IP means there is no machine w/ that IP fundementally, it is not
about name lookup

> If not, then CURLOPT_CONNECTTIMEOUT should time-out the operation.

I think so, but it does NOT happen
however, it times out after I use CURLOPT_CONNECT, I don't know why
CURLOPT_CONNECT can do that but CURLOPT_CONNECTTIMEOUT can't
there should not be any difference since it is in connection phase

I will do more tests today : )

Regds,
- Jerry

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Received on 2004-01-26