theSocket = s; buffer = new byte[65507]; dp = new DatagramPacket(buffer, buffer.length);
while (true) { try { theSocket.receive(dp); String s = new String(dp.getData(), 0, 0, dp.getLength()); System.out.println(s); Thread.yield(); } catch (IOException e) { System.err.println(e); } }