curl-library
Re: About the CURLOPT_TIMEOUT. or CURLOPT_CONNECTTIMEOUT in multi interface
Date: Sat, 23 Feb 2008 13:13:50 +0100 (CET)
On Sat, 23 Feb 2008, yi xia wrote:
> AND as i know the while(CURLM_CALL_MULTI_PERFORM ==
>            curl_multi_perform(_multi_handle, &still_running)); is used to
> do name resolved and connecting jobs.
I'm not sure I get it. curl_multi_perform() does just about everything: from 
resolving to connecting to transfering to closing down things.
> this job seems to be the biggest blocking
There are a few operations in libcurl that are still done in a blocking 
manner, but our ambition and goal is to get them all fixed eventually. If you 
run on a non-windows box without c-ares, I'd say the most notable blocking 
behaviour is the name resolving phase.
> can i use CURLOPT_CONNECTTIMEOUT or CURLOPT_TIMEOUT. to realize the timeout?
Yes you can. But not that with the "native" resolver for non-windows, there's 
only one way to abort it: with signals. And if you're doing a multi-threaded 
program signals are bad for you. Of course most often when you use the multi 
interface you may not be multi-threaded.
> As i test, this options can work if i use curl_easy_perform(), but it has no 
> effect in curl_multi_perform.
Then it sounds like there's a bug somewhere. Can you provide a small app for 
us that reproduces this problem?
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2008-02-23