cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Issue with CURL detecting network outage

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 16 Dec 2009 16:55:21 +0100 (CET)

On Wed, 16 Dec 2009, Jogeshwar Karthik Akundi wrote:

> Client uses CURL to connect to server using Connect_Only option.
> While the connection is running, if network cable is removed, the disconnect
> is not being detected.
> I use select() to verify readibility/writability on the socket and use
> curl_easy_read/write to receive/send data.
> when using the socket descriptor in read/write sets, select doesn't return
> FD_ISSET. it only times out.

...

> so I tried to skip select and force sending data to CURL if buffers are
> available. Then curl_easy_send returns success. It is able to send packets
> of 20 bytes (verified only a few packets though) without errors, while I
> hold the network cable in my hand.

That sounds odd, but maybe you should consider having your heartbeat system
require a response within a certain time anyway?

> In the same case, we get an error immediately on windows. This issue is OSX
> specific (atleast for me here).

Perhaps it is, but I'm not aware of any such OSX peculiarities. What does (the
equivalent of) strace show?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-12-16