curl-library
Re: How to find if the network is down when the transfer is in paused state.
Date: Fri, 10 Jun 2011 13:20:56 +0200 (CEST)
On Wed, 8 Jun 2011, Kaviyarasan wrote:
> To determine if the network is down, I'm using the options
> CURLOPT_LOW_SPEED_LIMIT, CURLOPT_LOW_SPEED_TIME and CURL_TIMEOUT in
> curl_easy_setopt function. Then, I call curl_easy_pause function to pause
> the transfer. Because of the above options that I have set, it closes the
> connection in paused state.
If CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME causes the connection to
get closed while the connection is paused then I might consider that a bug...
CURL_TIMEOUT is trickier.
> So, Is there any other way to find if the network is down when the transfer
> is in paused state?
Nothing is being sent or read when the connection is paused so it's not really
possibly to detect network errors unless you enable TCP keep-alives. libcurl
doesn't do keep-alives on its own.
> Can I reset the value of the above options in paused state?
I think you can!
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2011-06-10