class SCTest
{
public static void main(String[] args)
{
try
{
Socket t = new Socket("199.2.139.2", 13);
DataInputStream is = new DataInputStream(t.getInputStream());
boolean more = true;
while(more)
{
String str = is.readLine();
if(str == null) more = false;
else System.out.println(str);
}
}
catch(IOException e)
{
{
System.out.println("Error " + e);
}
}
}
This is the error that returned from the Java pmg.
java.lang.NullPointerException
at java.net.InetAddress.getAllByName(InetAddress.java:250)
at java.net.InetAddress.getByName(InetAddress.java:209)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:87)
at java.net.Socket.<init>(Socket.java:87)
at java.net.Socket.<init>(Socket.java:62)
at SCTest.main(SCTest.java:10)
I've tried putting the IP address in dotted and string format but
neither works (the addr works in C).
What's wrong ? I'm running this pmg on a RS6000 PowerPC cluster running
on AIX ver 4.1. The compilier is an IBM Java compilier 1.0.2C (I think)
with the JIT compilier.
Thanks for any help. Please email me at edd...@cs.umt.edu if possible.
Bunch of thanks in advance.
I don't recal having gotten a NullPointerException, but try the fixed
InetAddress from http://www.cdt.luth.se/~peppar/java/InetAddress/ and
see if that doesn't solve your problem.
Cheers,
Ronald