This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: recv and errno during a connection reset/closed by peer


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@sbcglobal.net

-----Original Message-----
From: Brian Ford [mailto:ford@vss.fsi.com] 
Sent: Tuesday, March 29, 2005 11:36 AM
To: Peter Stephens
Cc: cygwin@cygwin.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]