From owner-freebsd-java@FreeBSD.ORG Sat Feb 18 16:55:51 2006 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 514C816A420 for ; Sat, 18 Feb 2006 16:55:51 +0000 (GMT) (envelope-from nate@yogotech.com) Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF5D743D45 for ; Sat, 18 Feb 2006 16:55:50 +0000 (GMT) (envelope-from nate@yogotech.com) Received: from caddis.yogotech.com (caddis.yogotech.com [206.127.123.130]) by ns.yogotech.com (8.13.4/8.13.4) with ESMTP id k1IGtnAX052226; Sat, 18 Feb 2006 09:55:49 -0700 (MST) (envelope-from nate@yogotech.com) Received: from caddis.yogotech.com (localhost [127.0.0.1]) by caddis.yogotech.com (8.13.4/8.13.4) with ESMTP id k1IGtmoi073090; Sat, 18 Feb 2006 09:55:48 -0700 (MST) (envelope-from nate@caddis.yogotech.com) Received: (from nate@localhost) by caddis.yogotech.com (8.13.4/8.13.4/Submit) id k1IGtlSn073087; Sat, 18 Feb 2006 09:55:47 -0700 (MST) (envelope-from nate) From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17399.20883.741021.688682@caddis.yogotech.com> Date: Sat, 18 Feb 2006 09:55:47 -0700 To: Kurt Miller In-Reply-To: <43F72599.4030009@intricatesoftware.com> References: <43F4F22F.1060402@europe.yahoo-inc.com> <200602171054.11632.lists@intricatesoftware.com> <43F72599.4030009@intricatesoftware.com> X-Mailer: VM 7.17 under 21.4 (patch 19) "Constant Variable" XEmacs Lucid Cc: "Arne H. Juul" , freebsd-java@freebsd.org Subject: Re: SO_REUSEADDR should not also mean SO_REUSEPORT X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Nate Williams List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2006 16:55:51 -0000 > >>> I don't know why this code was put into the bsd jdk patches, it just > >>> seems plain wrong to me. It makes java subtly non-portable in a very > >>> strange manner; I suggest this code is removed. Below is the patch > >>> I'm currently using :-) > >> > >> > >> Linux and Solaris don't have SO_REUSEPORT. I believe their > >> SO_REUSEADDR is equivalent to SO_REUSEADDR + SO_REUSEPORT > >> on bsd. > > > > > > no, that's not true. > > SO_REUSEADDR behaves the same on bsd, linux, and solaris. > > > > I don't know if there's any way on linux or solaris > > to get the behaviour that SO_REUSEPORT triggers on FreeBSD. > > > Ok, thanks. I got that impression from reading some posts I found > while googling. There was one in particular for NetBSD that > discussed it in detail. Check out the Apr 2 portion of this > http://www.tinyurl.com/b46gq by Jan Schaumann. Also this > one http://tinyurl.com/9sa6a. From these posts it appears > that SO_REUSEPORT is needed in some cases to be compatible > with linux. >From the early days.... - In the Multicast constructor, the low level routine sets the SO_REUSEADDR option by using JSO_REUSEADDR which corresponds to a call to setsockopt(..SO_REUSEADDR). To make multicast sockets work in *all* cases on FreeBSD, we should also set SO_REUSEPORT, else in many cases the multicast bind will fail. Nate