cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re:Re: may i change the time of CURLE_OPERATION_TIMEDOUT

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 17 May 2011 11:44:20 +0200 (CEST)

On Tue, 17 May 2011, belle wrote:

>> "when the network is not good" is not a detectable situation as there's no
>> definition for such a network.
>
> o, you are right, there's no definition for such a network, i used the
> wrong description. what i mean is "when network is broken

"network is broken" is similarly not an exact situation.

Are you meaning when the connection is broken physically by you pulling the
plug?

Recall that TCP is generally a protocol that is designed not to care if the
connection is broken. It can continue very well once you put the cable back in
again.

> the function curl_easy_perform is not return and the CURLOPT_WRITEFUNCTION
> callback is not receive data anymore, that is the callback will be not used
> anymore, so i can't actively abort the operation, is there any other
> callback i can use to make the curl_easy_perform return immediately when the
> network is broken?

Use the progress callback or one of the many timeout options.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-05-17