curl-library
Facing few problems with Curl Multi timeouts...
Date: Sat, 27 Dec 2008 00:29:42 +0530
Hi All,
I am using curl-multi interface for the first time.
I am writing an application which requires "N" http - GET requests to be
made.
The responses received are processed by callbacks set using
"WRITEFUNCTION".
However, I don't want my application to be blocked for more than say 300ms.
In order to achieve this, I have done the following:
curl_easy_setopt(curl_easy_handle, CURLOPT_CONNECTTIMEOUT_MS, 50); //example
timeout values
curl_easy_setopt(curl_easy_handle, CURLOPT_TIMEOUT_MS, 150); //example
timeout values.
Later I add curl easy handles to curl multi handle using
curl_multi_add_handle(multi_handle, curl_easy_handle);
I later call curl_multi_perform()(in while loop)
I do a curl_multi_fdset(), do a select() and then call curl_multi_perform()
again ( This all is done in a loop, till still_running returned is 0).
In order to test timeouts, I have written a perl script and I have placed
in say http://testserver/cgi-bin/a.pl.
A delay of 10secs is programmed in the script. So, server, for sure delays
response for 10 secs.
However, the client side curl connection doesn't timeout. I blocks till it
gets all the data.
Also, i have built with AsyncDNS enabled and curl-config --features command
confirms the same.
What is the expected behaviour of millisecond timeouts??
Is anyone getting the same issue??
Regards,
Ameya
Thanks,
Dont think you are,
Know you are.
-Legendary Morpheus in The Matrix
Received on 2008-12-26