cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLOPT_CONNECTTIMEOUT and

From: Jerry G. Chiuan <jerry_at_oridus.com>
Date: Thu, 22 Jan 2004 20:51:28 -0800

Hi,
I have 3 questions while using CURLOPT_CONNECTTIMEOUT:
(ps: On my XP machine, the system timeout is 100 sec...)

Q1:
we don't need to worry about clean up *without* using CURLOPT_CONNECTTIMEOUT
( or our timeout is *longer* than system timeout) since system call will
time out and take care of clean-up, do we?

BUT, if we used CURLOPT_CONNECTTIMEOUT, e.g. 5(sec) which is *shorter* than
system timeout, do we need to worry about clean up?
Does it actually also use time-outing system calls like CURLOPT_TIMEOUT
does?, and we don't need to worry about clean up ourselves.
connection would be deleted by system.

Q3:
While we set CURLOPT_NOSIGNAL as non-zero, does curl still use signal to
enable time-outing system calls while we set up CURLOPT_TIMEOUT and
CURLOPT_CONNECTTIMEOUT?

If not, how does curl enable it?

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

I tried CURLOPT_CONNECTTIMEOUT and found it only works for case(2), it will
return back within even shorter than 5(sec), I don't know why?!

BUT for case(1), it still times out based on system timeout ( time out after
100 sec )
what can I do for case(1), can we use use CURLOPT_CONNECT for case(1)?

thanks a lot
- 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-23