cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Curllib on vista?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 5 Mar 2008 08:41:10 +0100 (CET)

On Tue, 4 Mar 2008, Jared Wilkin wrote:

> I see the potential problem with my proposed fix that it can be the case
> that a socket is idle for any period of time without being in an error
> state. However it is also true that a socket can be active for any period
> of time without being in an error state.

Correct, and libcurl handles both these situations!

> The reason I didn't use the existing timeout option to begin with was my app
> is potentially transferring large files and thus any set timeout value would
> have to be arbitrarily big enough to accommodate, but that also means we
> have to wait that long to detect a broken connection.

But then you could instead craft your own using the progress callback or the
CURLOPT_LOW_SPEED_LIMIT + CURLOPT_LOW_SPEED_TIME combo.

> So I guess the issue is what is the preferred way to detect a closed
> connection on Vista?

I don't think this is OS-dependent at all. TCP connections can be idle without
it being a problem and it is in fact *designed* to be able to cope with a
cable being pulled and put back again.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-03-05