#include "../logger.hpp" #include "configuration.hpp" #include "server.hpp" #include #include void HttpServer::Execute() { while(isOpen) { try { Connection newConnection = listeningSocket.AcceptNextConnection(); connectionOperator.HandleNewConnection(newConnection); } catch (std::runtime_error & e) { Logger::GetInstance().Info("Connection dropped on accept"); } } } HttpServer::HttpServer() : listeningSocket(ServerConfiguration::GetInstance().GetPort()), connectionOperator(), isOpen(true) { std::stringstream ss; ss << "Listening on port " << ServerConfiguration::GetInstance().GetPort(); Logger::GetInstance().Info(ss.str()); }