harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-507) [classlib] [net] java.net.Socket.connect(SocketAddress) throws unexpected ConnectException on Windows platform
Date Thu, 17 Aug 2006 19:07:14 GMT
     [ 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

        

Mime
View raw message