Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Tue, 5 Oct 2004 09:54:39 -0500
From: Brian Ford <ford@vss.fsi.com>
Reply-To: cygwin@cygwin.com
To: Dave Korn <dk@artimi.com>
cc: cygwin@cygwin.com
Subject: RE: setsockopt SO_REUSEADDR
In-Reply-To: <NUTMEGcvJY4WocwAQq10000027b@NUTMEG.CAM.ARTIMI.COM>
Message-ID: <Pine.CYG.4.58.0410050951540.5620@fordpc.vss.fsi.com>
References: <NUTMEGcvJY4WocwAQq10000027b@NUTMEG.CAM.ARTIMI.COM>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-IsSubscribed: yes

On Tue, 5 Oct 2004, Dave Korn wrote:

> > -----Original Message-----
> > From: cygwin-owner On Behalf Of Rainer Hochreiter
> > Sent: 05 October 2004 15:29
>
> > running the program listed below with argument 'reuse' under
> > cygwin and linux returns different results!
> >
> > from my point of view, the linux result is quite what i
> > expected, a bind() error 'Address already in use'.
>
>   Huh?  But that's exactly what SO_REUSEADDR is supposed to _prevent_
> from happening.  That's why it's called _REUSE_addr, because it lets you
> *re-use* an addr, without getting an error message.  Why would you
> expect setting it to stop you from reusing the address?

I was about to say the same thing, but...

http://www.unixguide.net/network/socketfaq/4.5.shtml

It is only supposed to reuse if the other socket is in the TIME_WAIT
state.  I think that is what he is complaining about.

BTW to the OP, why are you printing the address of the socket function
out?  I think you meant to print "s" instead of "socket"?

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

