Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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, 5 Oct 2004 09:54:39 -0500 From: Brian Ford Reply-To: cygwin AT cygwin DOT com To: Dave Korn cc: cygwin AT cygwin DOT com Subject: RE: setsockopt SO_REUSEADDR In-Reply-To: Message-ID: References: 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/