harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor Martynov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-946) [classlib][luni] new Socket("0.0.0.0", 1099) on Windows throws exception
Date Fri, 21 Jul 2006 11:05:14 GMT
[classlib][luni] new Socket("0.0.0.0", 1099) on Windows throws exception
------------------------------------------------------------------------

                 Key: HARMONY-946
                 URL: http://issues.apache.org/jira/browse/HARMONY-946
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: Windows XP, Apache Harmony DRLVM HEAD-4807 (2006-05-02), Windows/ia32/msvc
1310, debug

            Reporter: Victor Martynov


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.<init>(Socket.java:139)
        at Test.main(Test.java:7)

Moreover the results differ on Linux and Windows:


vamartyn@server:~> uname -a
Linux server 2.6.5-7.145lxset1-smp #1 SMP Thu Jan 27 09:19:29 UTC 2005 i686
i686 i386 GNU/Linux
vamartyn@server:~> Harmony/bin/ij -version
Apache Harmony DRLVM HEAD-4807 (2006-05-02), Linux/ia32/gcc 3.3.4, debug
vamartyn@server:~> Harmony/bin/ij Test 
vamartyn@server:~> java Test
vamartyn@server:~>

The address "0.0.0.0" is a valid address to connect, so it is a bug in luni.jar and it shows
itself only on windows.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message