This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Datagram Problems
- From: "Suman Sai" <saisuman at hotmail dot com>
- To: java at gcc dot gnu dot org
- Date: Mon, 18 Feb 2002 05:23:48
- Subject: Datagram Problems
- Bcc:
Hello, everyone.
Thanks, Bryce, for responding to my earlier query. Here's a code snippet,
the one that doesn't work. I get "Network Unreachable". Could you please
tell me why this is happening?
I'm on RedHat 7.1, Kernel 2.4, GCC 2.96.
import java.net.*;
import java.io.*;
class test
{
public static void main(String args[])
{
try{
String str = "Message.";
DatagramSocket ds = new DatagramSocket();
DatagramPacket dp = new
DatagramPacket(str.getBytes(), str.length(),
InetAddress.getByName("255.255.255.255"), 8888);
ds.send(dp);
ds.send(dp);
ds.close();
}catch(Exception e)
{
System.out.println("EXCEPTION: " + e.toString());
}
}
}
Thanks a lot.
-Regards,
Suman.
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com