cURL / Mailing Lists / curl-library / Single Mail

curl-library

About the CURLOPT_TIMEOUT. or CURLOPT_CONNECTTIMEOUT in multi interface

From: yi xia <max.xiayi_at_gmail.com>
Date: Sat, 23 Feb 2008 17:28:24 +0800

Hi All
I am a newbie of libcurl. I searched the mail list , but I can not get the
answer.

As we know , typical multi interface usage is
while(CURLM_CALL_MULTI_PERFORM ==
            curl_multi_perform(_multi_handle, &still_running));

    while(still_running)
    {

        curl_multi_fdset(_multi_handle, &fdread, &fdwrite, &fdexcep,
&maxfd);

        rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
        switch(rc)
        {
            case -1:
                break;
            case 0:
            default:
                while(CURLM_CALL_MULTI_PERFORM ==
                        curl_multi_perform(_multi_handle, &still_running));
                break;
        }
    }

    /* See how the transfers went */
    while(1)
    {
        msg = curl_multi_info_read(_multi_handle, &msgs_left);
...
}
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.

this job seems to be the biggest blocking, can i use CURLOPT_CONNECTTIMEOUT
or CURLOPT_TIMEOUT. to realize the timeout?
As i test, this options can work if i use curl_easy_perform(), but it has no
effect in curl_multi_perform.

what can i do?

Best regards

Max
Received on 2008-02-23