This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
InetSocketAddress w/ connect fails
- From: "Bradley L. Schatz" <bradley at bellevueaccountingsystems dot com dot au>
- To: <java at gcc dot gnu dot org>
- Date: Fri, 20 Jun 2003 15:04:46 +1000
- Subject: InetSocketAddress w/ connect fails
The code below fails. If I use a straight Socket(host, port) call
instead, it works.
I am using Mohan's 30522 build.
Has anyone observed this?
cheers,
bradley
C:\mysrc\gcj-test>hello
sources.redhat.com/66.187.233.205:80
No error
java.net.ConnectException: No error
at __ZN5Hello4mainEP6JArrayIPN4java4lang6StringEE
(C:\mysrc\gcj-test\Hello.ja
va:12)
at _main (C:\DOCUME~1\BRADLE~1.000\LOCALS~1\Temp\ccqUaaaa.i)
import java.net.*;
class Hello
{
public static void main(String[] args)
{
try
{
InetSocketAddress i = new InetSocketAddress("sources.redhat.com",
80);
Socket s = new Socket();
System.out.println(i.toString());
s.connect(i);
System.out.println("Hello World!");
}
catch (Exception ex)
{
System.err.println(ex.getMessage());
ex.printStackTrace();
}
}
}