From harmony-dev-return-10596-apmail-incubator-harmony-dev-archive=incubator.apache.org@incubator.apache.org Thu Jul 20 19:12:06 2006 Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 81169 invoked from network); 20 Jul 2006 19:12:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Jul 2006 19:12:06 -0000 Received: (qmail 95567 invoked by uid 500); 20 Jul 2006 13:58:58 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 95518 invoked by uid 500); 20 Jul 2006 13:58:58 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 95500 invoked by uid 99); 20 Jul 2006 13:58:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jul 2006 06:58:58 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of alexei.zakharov@gmail.com designates 64.233.166.181 as permitted sender) Received: from [64.233.166.181] (HELO py-out-1112.google.com) (64.233.166.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jul 2006 06:58:57 -0700 Received: by py-out-1112.google.com with SMTP id i75so740019pye for ; Thu, 20 Jul 2006 06:58:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WSgLD3PEV40cz07clmRCFAc41Q8CRMzl6EbjnkyOuBUlJV032W1ul+0/1i8xjAqWJfsR4In2ilPer+2irLZYJdywppqZIUF1em6A5Y7ygfs3zAnx9VwfvTKOYp4peVasQo8RJjkzXUr8lBubeAbJP3RvCNp+2RYSwM/7QE9Xl9Q= Received: by 10.35.62.19 with SMTP id p19mr1112615pyk; Thu, 20 Jul 2006 06:58:37 -0700 (PDT) Received: by 10.35.128.18 with HTTP; Thu, 20 Jul 2006 06:58:37 -0700 (PDT) Message-ID: <2c9597b90607200658u278a9620l218dae23e3112893@mail.gmail.com> Date: Thu, 20 Jul 2006 17:58:37 +0400 From: "Alexei Zakharov" To: harmony-dev@incubator.apache.org Subject: Re: [classlib] Uncertain behavior of new Socket("0.0.0.0", 1099); In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200607201144.k6KBiS29016181@d06av02.portsmouth.uk.ibm.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Mikhail, I don't think this description of DatagramSocket constructor is somehow applicable to the Victor's example. In this description we deal with *local* address to bind DatagramSocket to (to receive DatagramPackets). But in the example above 0.0.0.0 is used as a *destination* address for plain Socket to establish a connection to. This is the completely different case IMHO. BTW, I'm not sure it is possible to establish a connection to a wildcard address. Regards, 2006/7/20, Mikhail Fursov : > The documentation of java.net.Socket says nothing about 0.0.0.0 address, > but documentation on java.net.DatagramSocket has a reference to it: > http://java.sun.com/j2se/1.4.2/docs/api/java/net/DatagramSocket.html > "If the IP address is 0.0.0.0, the socket will be bound to the wildcard > address, an IP address chosen by the kernel." > > So it's normal to use 0.0.0.0 and we have a bug. > > > On 7/20/06, Victor A Martynov wrote: > > > > Hello Mark, > > > > I run the example on MS Windows XP, Harmony classlib+DRLVM dated 11 july > > 2006. > > > > c:\test>c:\Harmony\bin\ij -version > > Apache Harmony DRLVM HEAD-4807 (2006-05-02), Windows/ia32/msvc 1310, debug > > > > ===== > > Warm Regards, > > > > Victor Martynov, > > Intel Middleware Product Division > > > > > > On 7/20/06, Mark Hindess wrote: > > > > > > > > > On 20 July 2006 at 15:34, "Victor A Martynov" > > > > > wrote: > > > > > > > > Hello, > > > > > > > > I'm having trouble with an application. This problem concerns > > creating > > > > java.net.Socket on host "0.0.0.0". > > > > > > What platform? Works for me on Linux (debian testing). > > > > > > -Mark. > > > > > > > The test below illustrates this problem: > > > > > > > > import java.net.*; > > > > > > > > > > > > > > > > public class Test { > > > > > > > > > > > > > > > > public static void main(String args[]) throws Throwable { > > > > > > > > ServerSocket ss = new ServerSocket(1099); > > > > > > > > Socket s = new Socket("0.0.0.0", 1099); > > > > > > > > } > > > > > > > > } > > > > > > > > The output on RI and on Harmony differs: > > > > > > > > c:\test>java Test > > > > > > > > c:\test>C:/Harmony/bin/ij Test > > > > > > > > java.net.ConnectException: 0.0.0.0/0.0.0.0:1099 - The address is not > > > > available > > > > > > > > at org.apache.harmony.luni.net.PlainSocketImpl.connect( > > > > PlainSocketImpl.java:238) > > > > > > > > at org.apache.harmony.luni.net.PlainSocketImpl.connect( > > > > PlainSocketImpl.java:200) > > > > > > > > at java.net.Socket.startupSocket(Socket.java:715) > > > > > > > > at java.net.Socket.(Socket.java:139) > > > > > > > > at Test.main(Test.java:7) > > > > > > > > > > > > > > > > I wonder whether it is a bug in RI or a bug in LUNI of Harmony? > > > > > > > > ===== > > > > Warm Regards, > > > > > > > > Victor Martynov, > > > > Intel Middleware Product Division > > > > > > > > ------=_Part_57416_17500570.1153395298489-- > > > > > > > > > > > > --------------------------------------------------------------------- > > > Terms of use : http://incubator.apache.org/harmony/mailing.html > > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > > > > > > > > > > > > -- > Mikhail Fursov > > -- Alexei Zakharov, Intel Middleware Product Division --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org