You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Svetlana Samoilenko (JIRA)" <ji...@apache.org> on 2006/05/25 06:57:29 UTC

[jira] Created: (HARMONY-507) [classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected ConnectException on Windows platform

[classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected  ConnectException on Windows platform 
----------------------------------------------------------------------------------------------------------------

         Key: HARMONY-507
         URL: http://issues.apache.org/jira/browse/HARMONY-507
     Project: Harmony
        Type: Bug

  Components: Classlib  
    Reporter: Svetlana Samoilenko


Harmony does not connect with a server and throws  "java.net.ConnectException: ... - The address is not available" in the trivial test while RI works fine.
Note, that on Linux there is no exception, only on Windows.

import java.net.*;

public class test  {
 public static void main(String [] args) { 
     int port =0;
     try{
        ServerSocket server = new ServerSocket(port);
        String host = server.getInetAddress().getHostName();
        port=server.getLocalPort();
        System.out.println("host="+host);
        System.out.println("port="+port);

        Socket client = new Socket();
        InetSocketAddress ia=new InetSocketAddress(host, port);
        System.out.println("ia.host="+ia.getHostName());
        System.out.println("ia.port="+ia.getPort());

        client.connect(ia);  
        System.out.println("client.isConnected="+client.isConnected());
     } catch (IOException e) {
        e.printStackTrace();
     };
   }
}
Output on RI:
host=0.0.0.0
port=3113
ia.host=0.0.0.0
ia.port=3113
client.isConnected=true

Output on Harmony (Windows):
host=0.0.0.0
port=3220
ia.host=0.0.0.0
ia.port=3220
java.net.ConnectException: 0.0.0.0/0.0.0.0:3220 - The address is not available
        at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:240)
        at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:605)
        at java.net.Socket.connect(Socket.java:951)
        at java.net.Socket.connect(Socket.java:898)
        at test.main(test.java:24)

	

-- 
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


[jira] Commented: (HARMONY-507) [classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected ConnectException on Windows platform

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-507?page=comments#action_12426212 ] 
            
Alexey Petrenko commented on HARMONY-507:
-----------------------------------------

This issue is duplicate of JIRA 946 and should be closed.

> [classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected  ConnectException on Windows platform
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-507
>                 URL: http://issues.apache.org/jira/browse/HARMONY-507
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Svetlana Samoilenko
>         Attachments: SocketTest.java
>
>
> Harmony does not connect with a server and throws  "java.net.ConnectException: ... - The address is not available" in the trivial test while RI works fine.
> Note, that on Linux there is no exception, only on Windows.
> import java.net.*;
> public class test  {
>  public static void main(String [] args) { 
>      int port =0;
>      try{
>         ServerSocket server = new ServerSocket(port);
>         String host = server.getInetAddress().getHostName();
>         port=server.getLocalPort();
>         System.out.println("host="+host);
>         System.out.println("port="+port);
>         Socket client = new Socket();
>         InetSocketAddress ia=new InetSocketAddress(host, port);
>         System.out.println("ia.host="+ia.getHostName());
>         System.out.println("ia.port="+ia.getPort());
>         client.connect(ia);  
>         System.out.println("client.isConnected="+client.isConnected());
>      } catch (IOException e) {
>         e.printStackTrace();
>      };
>    }
> }
> Output on RI:
> host=0.0.0.0
> port=3113
> ia.host=0.0.0.0
> ia.port=3113
> client.isConnected=true
> Output on Harmony (Windows):
> host=0.0.0.0
> port=3220
> ia.host=0.0.0.0
> ia.port=3220
> java.net.ConnectException: 0.0.0.0/0.0.0.0:3220 - The address is not available
>         at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:240)
>         at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:605)
>         at java.net.Socket.connect(Socket.java:951)
>         at java.net.Socket.connect(Socket.java:898)
>         at test.main(test.java:24)
> 	

-- 
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

        

[jira] Assigned: (HARMONY-507) [classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected ConnectException on Windows platform

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-507?page=all ]

Tim Ellison reassigned HARMONY-507:
-----------------------------------

    Assignee: Tim Ellison

> [classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected  ConnectException on Windows platform
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-507
>                 URL: http://issues.apache.org/jira/browse/HARMONY-507
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Svetlana Samoilenko
>         Assigned To: Tim Ellison
>         Attachments: SocketTest.java
>
>
> Harmony does not connect with a server and throws  "java.net.ConnectException: ... - The address is not available" in the trivial test while RI works fine.
> Note, that on Linux there is no exception, only on Windows.
> import java.net.*;
> public class test  {
>  public static void main(String [] args) { 
>      int port =0;
>      try{
>         ServerSocket server = new ServerSocket(port);
>         String host = server.getInetAddress().getHostName();
>         port=server.getLocalPort();
>         System.out.println("host="+host);
>         System.out.println("port="+port);
>         Socket client = new Socket();
>         InetSocketAddress ia=new InetSocketAddress(host, port);
>         System.out.println("ia.host="+ia.getHostName());
>         System.out.println("ia.port="+ia.getPort());
>         client.connect(ia);  
>         System.out.println("client.isConnected="+client.isConnected());
>      } catch (IOException e) {
>         e.printStackTrace();
>      };
>    }
> }
> Output on RI:
> host=0.0.0.0
> port=3113
> ia.host=0.0.0.0
> ia.port=3113
> client.isConnected=true
> Output on Harmony (Windows):
> host=0.0.0.0
> port=3220
> ia.host=0.0.0.0
> ia.port=3220
> java.net.ConnectException: 0.0.0.0/0.0.0.0:3220 - The address is not available
>         at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:240)
>         at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:605)
>         at java.net.Socket.connect(Socket.java:951)
>         at java.net.Socket.connect(Socket.java:898)
>         at test.main(test.java:24)
> 	

-- 
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

        

[jira] Updated: (HARMONY-507) [classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected ConnectException on Windows platform

Posted by "Svetlana Samoilenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-507?page=all ]

Svetlana Samoilenko updated HARMONY-507:
----------------------------------------

    Attachment: SocketTest.java

unit test

> [classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected  ConnectException on Windows platform
> ---------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-507
>          URL: http://issues.apache.org/jira/browse/HARMONY-507
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>  Attachments: SocketTest.java
>
> Harmony does not connect with a server and throws  "java.net.ConnectException: ... - The address is not available" in the trivial test while RI works fine.
> Note, that on Linux there is no exception, only on Windows.
> import java.net.*;
> public class test  {
>  public static void main(String [] args) { 
>      int port =0;
>      try{
>         ServerSocket server = new ServerSocket(port);
>         String host = server.getInetAddress().getHostName();
>         port=server.getLocalPort();
>         System.out.println("host="+host);
>         System.out.println("port="+port);
>         Socket client = new Socket();
>         InetSocketAddress ia=new InetSocketAddress(host, port);
>         System.out.println("ia.host="+ia.getHostName());
>         System.out.println("ia.port="+ia.getPort());
>         client.connect(ia);  
>         System.out.println("client.isConnected="+client.isConnected());
>      } catch (IOException e) {
>         e.printStackTrace();
>      };
>    }
> }
> Output on RI:
> host=0.0.0.0
> port=3113
> ia.host=0.0.0.0
> ia.port=3113
> client.isConnected=true
> Output on Harmony (Windows):
> host=0.0.0.0
> port=3220
> ia.host=0.0.0.0
> ia.port=3220
> java.net.ConnectException: 0.0.0.0/0.0.0.0:3220 - The address is not available
>         at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:240)
>         at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:605)
>         at java.net.Socket.connect(Socket.java:951)
>         at java.net.Socket.connect(Socket.java:898)
>         at test.main(test.java:24)
> 	

-- 
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


[jira] Commented: (HARMONY-507) [classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected ConnectException on Windows platform

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-507?page=comments#action_12426234 ] 
            
Tim Ellison commented on HARMONY-507:
-------------------------------------

Svetlana, please confirm that this is no longer a problem for you in the current code.


> [classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected  ConnectException on Windows platform
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-507
>                 URL: http://issues.apache.org/jira/browse/HARMONY-507
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Svetlana Samoilenko
>         Assigned To: Tim Ellison
>         Attachments: SocketTest.java
>
>
> Harmony does not connect with a server and throws  "java.net.ConnectException: ... - The address is not available" in the trivial test while RI works fine.
> Note, that on Linux there is no exception, only on Windows.
> import java.net.*;
> public class test  {
>  public static void main(String [] args) { 
>      int port =0;
>      try{
>         ServerSocket server = new ServerSocket(port);
>         String host = server.getInetAddress().getHostName();
>         port=server.getLocalPort();
>         System.out.println("host="+host);
>         System.out.println("port="+port);
>         Socket client = new Socket();
>         InetSocketAddress ia=new InetSocketAddress(host, port);
>         System.out.println("ia.host="+ia.getHostName());
>         System.out.println("ia.port="+ia.getPort());
>         client.connect(ia);  
>         System.out.println("client.isConnected="+client.isConnected());
>      } catch (IOException e) {
>         e.printStackTrace();
>      };
>    }
> }
> Output on RI:
> host=0.0.0.0
> port=3113
> ia.host=0.0.0.0
> ia.port=3113
> client.isConnected=true
> Output on Harmony (Windows):
> host=0.0.0.0
> port=3220
> ia.host=0.0.0.0
> ia.port=3220
> java.net.ConnectException: 0.0.0.0/0.0.0.0:3220 - The address is not available
>         at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:240)
>         at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:605)
>         at java.net.Socket.connect(Socket.java:951)
>         at java.net.Socket.connect(Socket.java:898)
>         at test.main(test.java:24)
> 	

-- 
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

        

[jira] Closed: (HARMONY-507) [classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected ConnectException on Windows platform

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-507?page=all ]

Tim Ellison closed HARMONY-507.
-------------------------------

    Resolution: Fixed

No response from raiser.  Assuming ok.


> [classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected  ConnectException on Windows platform
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-507
>                 URL: http://issues.apache.org/jira/browse/HARMONY-507
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Svetlana Samoilenko
>         Assigned To: Tim Ellison
>         Attachments: SocketTest.java
>
>
> Harmony does not connect with a server and throws  "java.net.ConnectException: ... - The address is not available" in the trivial test while RI works fine.
> Note, that on Linux there is no exception, only on Windows.
> import java.net.*;
> public class test  {
>  public static void main(String [] args) { 
>      int port =0;
>      try{
>         ServerSocket server = new ServerSocket(port);
>         String host = server.getInetAddress().getHostName();
>         port=server.getLocalPort();
>         System.out.println("host="+host);
>         System.out.println("port="+port);
>         Socket client = new Socket();
>         InetSocketAddress ia=new InetSocketAddress(host, port);
>         System.out.println("ia.host="+ia.getHostName());
>         System.out.println("ia.port="+ia.getPort());
>         client.connect(ia);  
>         System.out.println("client.isConnected="+client.isConnected());
>      } catch (IOException e) {
>         e.printStackTrace();
>      };
>    }
> }
> Output on RI:
> host=0.0.0.0
> port=3113
> ia.host=0.0.0.0
> ia.port=3113
> client.isConnected=true
> Output on Harmony (Windows):
> host=0.0.0.0
> port=3220
> ia.host=0.0.0.0
> ia.port=3220
> java.net.ConnectException: 0.0.0.0/0.0.0.0:3220 - The address is not available
>         at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:240)
>         at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:605)
>         at java.net.Socket.connect(Socket.java:951)
>         at java.net.Socket.connect(Socket.java:898)
>         at test.main(test.java:24)
> 	

-- 
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