Server¶
-
namespace HTTPServer
-
class Server¶
Public Functions
-
explicit Server()¶
-
explicit Server(const std::string &config_path)¶
-
void start()¶
-
void installSignalHandlers()¶
-
void stop()¶
Private Types
-
using UniqueSSL_CTX = std::unique_ptr<SSL_CTX, decltype(&SSL_CTX_free)>¶
Private Functions
-
template<typename Address, typename Handler>
void accept_loop(int listen_fd, std::atomic<bool> &running, Handler handler)¶
-
bool init_ssl_context()¶
-
void cleanup_ssl_context()¶
-
void dispatch_client(int client_fd)¶
-
void handle_client(SSL *ssl, const std::string &client_ip)¶
-
void handle_client(int client_fd, const std::string &client_ip)¶
Private Members
-
std::atomic<bool> d_running = {false}¶
-
std::unique_ptr<ThreadPool> d_thread_pool¶
-
UniqueSSL_CTX ssl_ctx = {nullptr, SSL_CTX_free}¶
-
std::unique_ptr<PerioidIdleIpCleanup> d_periodic_idle_ip_cleanup¶
-
explicit Server()¶
-
class Server¶