delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/05/09:26:58

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
To: cygwin AT cygwin DOT com
Subject: Re: UDP socket select/recvfrom problem when no server
References: <m2fzbj6c5d DOT fsf AT bluesteel DOT grierwhite DOT com> <20040405081543 DOT GC26575 AT cygbert DOT vinschen DOT de>
From: posts AT grierwhite DOT com (Christopher J. White)
In-Reply-To: <20040405081543.GC26575@cygbert.vinschen.de> (Corinna Vinschen's message of "Mon, 5 Apr 2004 10:15:43 +0200")
User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (darwin)
Date: Mon, 05 Apr 2004 09:26:52 -0400
Message-ID: <m2lllay2qr.fsf@bluesteel.grierwhite.com>
MIME-Version: 1.0
X-OriginalArrivalTime: 05 Apr 2004 13:26:40.0615 (UTC) FILETIME=[A133FF70:01C41B11]
X-IsSubscribed: yes

>>>>> "corinna" == Corinna Vinschen <corinna-cygwin at cygwin dot com> writes:

corinna> There is only a 1.5.9-1 version.  From what version did you update?
corinna> AFAICS, there was no relevant change in socket code since 1.5.7.

Might have been 1.5.7 then.  I've been updating via cygwin setup
about every week or two, so not too long...

corinna> Did you try the same on a Linux box?  Does it behave differently?
corinna> Can you provide a brief testcase which compiles OOTB to demonstrate
corinna> the problem?

Works fine on Mac OSX.  I don't have access to a Linux box.  I'm
fairly certain I have made no changes to the socket portions of
my app in the last few weeks.

cj> I suspect that the destination is returning an ICMP error when the
cj> server is not running and that is what's giving select() something to
cj> look at. 

Indeed, this is the case... Capture with Ethereal confirms it.

cj> However, it's my understanding that unless I do a connect(),
cj> ICMP errors are not propogated to the app.  In addition, errno should
cj> be ECONNREFUSED in this case, and not ECONNRESET.

corinna> ECONNRESET is correct according to SUSv3.

Yes, according to POSIX, ECONNREFUSED is not a valid return
code for recvfrom().  However, it's not clear to me that
ECONNRESET is proper for a connection-less socket, in this
case a UDP socket for which no connect() was issued.  
I've seen other implementations that return ECONNREFUSED,
which at least is a more appropriate error code than
"connection forcibly reset by peer".

Now that I know what's going on, I can certainly code to it.

...cj

-- 
------------------------
-- Christopher J. White                                    
--
-- chris at (---)
--   grierwhite dot com
------------------------


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