Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String args[]) throws Exception {
- int port = 2000;
- DatagramSocket socket = new DatagramSocket(port);
- DatagramPacket packet;
- packet = new DatagramPacket(misc_data, misc_length, new InetSocketAddress("192.168.168.255", 47808));
- socket.send(packet);
- // Listen
- while (true) {
- packet = new DatagramPacket(new byte[1497], 1497);
- socket.receive(packet);
- //do something with the data
- }
- }
Add Comment
Please, Sign In to add comment