#ifndef CHECKS_PARSER_HTTP_SERVER #define CHECKS_PARSER_HTTP_SERVER #include #include #include #include class HttpServer { private: unsigned short port; int serverSocket; sockaddr_in serverAddress; QWidget* caller; std::thread listenClientsThread; std::vector clientHandlersThreads; bool started; void generateRandomPort(); public: HttpServer(QWidget *caller); ~HttpServer(); int start(); void stop(); void handleClient(int clientSocket); void acceptClients(); unsigned short getPort(); bool isStarted(); }; #endif //CHECKS_PARSER_HTTP_SERVER