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: UDP socket select/recvfrom problem when no server


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


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