try {
byte buffer = new byte[65536];
DatagramPacket incoming = new DatagramPacket(buffer, buffer.length);
DatagramSocket ds = new DatagramSocket(2134);
ds.receive(incoming);
byte[] data = incoming.getData();
String s = new String(data, 0, data.getLength());
System.out.println("Port" + incoming.getPort() + " on "
+ incoming.getAddress() + " sent this message:");
System.out.println(s);
}
catch (IOException ex) {
System.err.println(ex);
}