From owner-freebsd-java@FreeBSD.ORG Wed Apr 9 11:27:32 2003 Return-Path: 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 4626337B401 for ; Wed, 9 Apr 2003 11:27:32 -0700 (PDT) Received: from axl.seasidesoftware.co.za (axl.seasidesoftware.co.za [196.31.7.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7982643FBD for ; Wed, 9 Apr 2003 11:27:30 -0700 (PDT) (envelope-from sheldonh@starjuice.net) Received: from sheldonh by axl.seasidesoftware.co.za with local (Exim 4.12) id 193KI9-0006pK-00; Wed, 09 Apr 2003 20:27:25 +0200 Date: Wed, 9 Apr 2003 20:27:25 +0200 From: Sheldon Hearn To: Jan Grant Message-ID: <20030409182725.GS9708@starjuice.net> Mail-Followup-To: Jan Grant , freebsd-java@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i Sender: Sheldon Hearn cc: freebsd-java@freebsd.org Subject: Re: Question about native 1.4.1, InetAddress.getLocalHost() - bug? X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 18:27:32 -0000 On (2003/04/09 18:36), Jan Grant wrote: > Should this do what I think it should? When I created a ServerSocket > using > > s = new ServerSocket(1234, 0, InetAddress.getLocalHost()); > > I wound up with netstat reporting that I had a TCP connection listening > on 192.168.0.1.1234. From the description of the call, I'd expect > to see it listening on 127.0.0.1.1234. I must admit, I'd expect any IP address bound to a local interface to be valid. In other words, I'd expect to see what you're seeing. Note that jre-1.4.1 on Windows gives the same results. Note that the API documentation says that getLocalHost() returns IP address of "the local host", not "localhost". This is vague in the context of hosts with multiple local addresses. Ciao, Sheldon.