Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Peter Stephens" To: "'Brian Ford'" Cc: Subject: RE: recv and errno during a connection reset/closed by peer Date: Wed, 30 Mar 2005 01:28:52 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: Brian, I will look at this also. I appreciated all of the suggestions, but really just wanted to understand why Cygwin and Linux would be different in this area. The original reason behind posting to this group was because I believed that my install of Cygwin was not following the SusV3 spec. I'm still not really convinced it does, but that may be because the spec seems vague to me about the return when using MSG_PEEK. Perhaps it is not supposed to follow SusV3? I believed that there were several options to accomplish my task including: poll, select, MSG_PEEK, and non-blocking. While investigating all of these to determine the best one I noticed this difference between the Linux and Cygwin networking. I think they both aim to follow the same SusVx spec. Is that not true? If so, someone interpreted it differently or couldn't follow the correct implementation for some reason. Thanks Peter A. Stephens ptfoof AT sbcglobal DOT net -----Original Message----- From: Brian Ford [mailto:ford AT vss DOT fsi DOT com] Sent: Tuesday, March 29, 2005 11:36 AM To: Peter Stephens Cc: cygwin AT cygwin DOT com Subject: RE: recv and errno during a connection reset/closed by peer On Mon, 28 Mar 2005, Peter Stephens wrote: > Brian > > Are you saying that there is no way to distinguish a dropped > connection from a MSG_PEEK with no data to retrieve? AFAIK, yes. Why are you using this MSG_PEEK method? Why not just do a poll and look for POLLHUP (http://www.opengroup.org/onlinepubs/009695399/functions/poll.html): POLLHUP The device has been disconnected. This event and POLLOUT are mutually-exclusive; a stream can never be writable if a hangup has occurred. However, this event and POLLIN, POLLRDNORM, POLLRDBAND, or POLLPRI are not mutually-exclusive. This flag is only valid in the revents bitmask; it shall be ignored in the events member. and http://cygwin.com/acronyms/#PCYMTNQREAIYR ;-). -- 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/