recv and errno during a connection reset/closed by peer
Brian Ford
ford@vss.fsi.com
Tue Mar 29 18:43:00 GMT 2005
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/
More information about the Cygwin
mailing list