#ifndef HTTPD_H #define HTTPD_H #include "http_connection.h" #include #include #include namespace HTTP { class Server { public: Server(boost::asio::io_service& io_service, const tcp::endpoint& endpoint); void add_handler(const std::string& name, Handler handler); private: void start_accept(); void handle_accept(Connection::p new_connection, const boost::system::error_code& error); void handle_request(Connection::p connection); tcp::acceptor acceptor_; std::map handlers; }; } #endif