Guest User

Untitled

a guest
Oct 20th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public static void main(String args[]) throws Exception {
  2. int port = 2000;
  3. DatagramSocket socket = new DatagramSocket(port);
  4. DatagramPacket packet;
  5.  
  6. packet = new DatagramPacket(misc_data, misc_length, new InetSocketAddress("192.168.168.255", 47808));
  7. socket.send(packet);
  8.  
  9. // Listen
  10. while (true) {
  11. packet = new DatagramPacket(new byte[1497], 1497);
  12. socket.receive(packet);
  13. //do something with the data
  14. }
  15. }
Add Comment
Please, Sign In to add comment