public class UdpAcceptTest1
{
public static void main(String[] args) throws IOException
{
DatagramSocket ds = new DatagramSocket(10000);
byte[] by = new byte[1024];
DatagramPacket dp = new DatagramPacket(by,by.length);
ds.receive(dp);
String ip = dp.getAddress().getHostAddress();
int port = dp.getPort();
String txt = new String(dp.getData(),0,dp.getData().length);
System.out.println(ip);
System.out.println(port);
System.out.println(txt);
ds.close();