#include <iostream>
#include <string>
#include <vector>
#include <thread>

class StressTester {
public:
    void execute(std::string target, int port) {
        // Logic for sending packets/requests
        if (connectToServer(target, port)) {
            std::cout << "[SUCCESS] Request Sent to: " << target << ":" << port << std::endl;
        } else {
            std::cout << "[FAILED] Connection dropped." << std::endl;
        }
    }

private:
    bool connectToServer(std::string addr, int port) {
        // Socket implementation here
        return true; 
    }
};

void OnButtonClick(std::string inputField) {
    if (inputField.empty()) {
        std::cout << "WAIT-- FILL THE DOMAIN/IP FIRST" << std::endl;
        return;
    }

    std::string targetIP = resolveTarget(inputField);
    int port = autoDetectPort(targetIP);

    if (isValid(targetIP)) {
        confirmAndSend(targetIP, port);
    } else {
        std::cout << "ERROR: Invalid Domain or IP" << std::endl;
    }
}