202203204205206207208209210211212
try { final byte[] buf = new byte[256]; // Send request Datagram packet = udpCon.newDatagram(buf, buf.length); udpCon.send(packet); // Get response packet = udpCon.newDatagram(buf, buf.length); udpCon.receive(packet);