cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Curllib on vista?

From: Jared Wilkin <JaredW_at_vulcan.com>
Date: Wed, 5 Mar 2008 10:22:54 -0800

 

>> 2008/3/4, Jared Wilkin wrote:
>> So I guess the issue is what is the preferred way to detect a closed
>> connection on Vista?

>2008/3/5, Daniel Stenburg wrote:
>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.

I think it would be best for me to explain exactly what I am seeing and
perhaps you can tell me if this is expected behavior. (for these tests
the same libcurl.lib and .dll were used)

On XP: during an active connection (in the middle of a data transfer),
if the cable is pulled libcurl detects a broken connection and exits
gracefully. Libcurl properly detects the broken connection because the
behavior of select on XP is as it is documented
(http://msdn2.microsoft.com/en-us/library/ms740141(VS.85).aspx).

On Vista: During an active connection (in the middle of a data
transfer), if the cable is pulled libcurl does not detect the broken
connection. The result of this is that libcurl sits in an infinite loop
(the select call repeatedly returns 0, for timeout, which causes libcurl
to keep checking). Plugging the cable back in has no effect on this
loop. I let it run overnight and it never returns. I was not using
those LOW_SPEED options (which I will look into doing), but aside from
setting those, is an infinite loop expected behavior?

I have seen this behavior on 3 vista machines, 2 running business and 1
running home premium. Thanks for all your responses thus far.

Jared

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