Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Tue, 29 Mar 2005 10:37:21 -0600
From: Brian Ford <ford@vss.fsi.com>
Reply-To: cygwin@cygwin.com
To: "Peter A. Castro" <doctor@fruitbat.org>
cc: Peter Stephens <ptfoof@sbcglobal.net>, cygwin@cygwin.com
Subject: RE: recv and errno during a connection reset/closed by peer
In-Reply-To: <Pine.LNX.4.60.0503281549130.736@gremlin.fruitbat.org>
Message-ID: <Pine.CYG.4.58.0503291036300.3732@fordpc.vss.fsi.com>
References: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAUKQItienSEKG+9226yKd5cKAAAAQAAAADZbnjoLqKEeI3+lfe/tpAgEAAAAA@sbcglobal.net> <Pine.LNX.4.60.0503281549130.736@gremlin.fruitbat.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-OriginalArrivalTime: 29 Mar 2005 16:37:27.0435 (UTC) FILETIME=[97EC9DB0:01C5347D]

On Mon, 28 Mar 2005, Peter A. Castro wrote:

> As someone who's seen this behaviour on several platforms, it can happen.
> I've had to deal with this little annoyance in other products by having a
> retry counter loop.  So many consecutive recv()s of 0 length constitues a
> closed connection.  Something like this might work here as well?

If you are doing a normal blocking recv without MSG_PEEK, any return of 0
should mean a closed connection AFAIK.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained pilot...

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

