delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/29/20:24:55

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Tue, 29 Mar 2005 17:22:23 -0800 (PST)
From: "Peter A. Castro" <doctor AT fruitbat DOT org>
To: cygwin AT cygwin DOT com
cc: Peter Stephens <ptfoof AT sbcglobal DOT net>
Subject: RE: recv and errno during a connection reset/closed by peer
In-Reply-To: <Pine.CYG.4.58.0503291046020.3732@fordpc.vss.fsi.com>
Message-ID: <Pine.LNX.4.60.0503291718310.736@gremlin.fruitbat.org>
References: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAUKQItienSEKG+9226yKd5cKAAAAQAAAAng309fJS5U24MEanjzM6UgEAAAAA AT sbcglobal DOT net> <Pine DOT CYG DOT 4 DOT 58 DOT 0503291046020 DOT 3732 AT fordpc DOT vss DOT fsi DOT com>
MIME-Version: 1.0
X-IsSubscribed: yes

On Tue, 29 Mar 2005, Brian Ford wrote:

> On Mon, 28 Mar 2005, Peter Stephens wrote:
>
>> FYI - I tried setting the SO_LINGER and the SO_RCVTIMEO on Linux and on
>> Cygwin (see code below).  It makes sense to me that if the timeout has been
>> exceeded then the recv(..., MSG_PEEK) should do something.  On Cygwin it
>> doesn't do anything.
>
> I don't have time to check, but I imagine this is just a
> http://cygwin.com/acronyms/#PTC.

Yep, but I don't have time either, and this is a common enough problem
for other platforms. :(

>> On Linux it DOES time out, but it returns -1 and errno=EAGAIN.  This is an
>> interesting choice for errno
>
> Yes, it is the correct one.

I agree.

>> (perhaps ECONNABORTED, ESHUTDOWN, ECOMM,
>
> definately not.  Just because a recv timed out doesn't mean the connection
> is closed.
>
>> ETIME, ETIMEDOUT,
>
> Maybe.
>
>> EHOSTUNREACH, or ENOLINK would have been better choices),
>
> No as above.
>
>> The spec is kinda vague about the response to a MSG_PEEK when the connection
>> is lost, but I think that you could write a book on this subject with all
>> the possible combinations.
>
> Yup.  It's called "Unix Network Programming" by W. Richard Stevens ;-).

I believe I've got a copy of that book.  I'll have to dust it off and see
if it has any pronouncements in this area :)

> --
> Brian Ford

-- 
Peter A. Castro <doctor AT fruitbat DOT org> or <Peter DOT Castro AT oracle DOT com>
 	"Cats are just autistic Dogs" -- Dr. Tony Attwood

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019