// Path: app/src/main/java/com/aaronjwood/portauthority/response/MainAsyncResponse.java
// public interface MainAsyncResponse extends ErrorAsyncResponse {
// 
//     /**
//      * Delegate to handle Host + AtomicInteger outputs
//      *
//      * @param h
//      * @param i
//      */
//     void processFinish(Host h, AtomicInteger i);
// 
//     /**
//      * Delegate to handle integer outputs
//      *
//      * @param output
//      */
//     void processFinish(int output);
// 
//     /**
//      * Delegate to handle string outputs
//      *
//      * @param output
//      */
//     void processFinish(String output);
// 
//     /**
//      * Delegate to handle boolean outputs
//      *
//      * @param output
//      */
//     void processFinish(boolean output);
// 
// }


import com.aaronjwood.portauthority.response.MainAsyncResponse;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.math.BigInteger;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
package com.aaronjwood.portauthority.runnable;



public class ScanHostsRunnable implements Runnable {
    private final int start;
    private final int stop;
    private final int timeout;
    private final WeakReference<MainAsyncResponse> delegate;

    /**
     * Constructor to set the necessary data to scan for hosts
     *
     * @param start    Host to start scanning at
     * @param stop     Host to stop scanning at
     * @param timeout  Socket timeout
     * @param delegate Called when host discovery has finished
     */
// Path: app/src/main/java/com/aaronjwood/portauthority/response/MainAsyncResponse.java
// public interface MainAsyncResponse extends ErrorAsyncResponse {
// 
//     /**
//      * Delegate to handle Host + AtomicInteger outputs
//      *
//      * @param h
//      * @param i
//      */
//     void processFinish(Host h, AtomicInteger i);
// 
//     /**
//      * Delegate to handle integer outputs
//      *
//      * @param output
//      */
//     void processFinish(int output);
// 
//     /**
//      * Delegate to handle string outputs
//      *
//      * @param output
//      */
//     void processFinish(String output);
// 
//     /**
//      * Delegate to handle boolean outputs
//      *
//      * @param output
//      */
//     void processFinish(boolean output);
// 
// }


// Path: app/src/main/java/com/aaronjwood/portauthority/runnable/ScanHostsRunnable.java
import com.aaronjwood.portauthority.response.MainAsyncResponse;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.math.BigInteger;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;

package com.aaronjwood.portauthority.runnable;



public class ScanHostsRunnable implements Runnable {
    private final int start;
    private final int stop;
    private final int timeout;
    private final WeakReference<MainAsyncResponse> delegate;

    /**
     * Constructor to set the necessary data to scan for hosts
     *
     * @param start    Host to start scanning at
     * @param stop     Host to stop scanning at
     * @param timeout  Socket timeout
     * @param delegate Called when host discovery has finished
     */
    public ScanHostsRunnable(int start, int stop, int timeout, WeakReference<MainAsyncResponse> delegate) {