#ifndef HTTPD_H #define HTTPD_H #include "http_connection.h" #include #include #include namespace HTTP { typedef boost::function Handler; 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); tcp::acceptor acceptor_; std::map handlers; }; } #endif