1 #ifndef CPP_WEB_SERVER_HTTP_SERVER_HPP 2 #define CPP_WEB_SERVER_HTTP_SERVER_HPP 7 #include <boost/asio.hpp> 8 #include <boost/function.hpp> 9 #include <boost/noncopyable.hpp> 10 #include <boost/shared_ptr.hpp> 11 #include <boost/thread/thread.hpp> 29 HttpServer(
const std::string& address,
const std::string& port,
31 std::size_t thread_pool_size);
46 std::vector<boost::shared_ptr<boost::thread>>
threads_;
std::size_t thread_pool_size_
boost::shared_ptr< HttpConnection > new_connection_
boost::asio::io_service io_service_
boost::asio::ip::tcp::acceptor acceptor_
void handle_accept(const boost::system::error_code &e)
boost::function< bool(const HttpRequest &, boost::shared_ptr< HttpConnection >, const char *begin, const char *end)> HttpServerRequestHandler
std::vector< boost::shared_ptr< boost::thread > > threads_
HttpServer(const std::string &address, const std::string &port, HttpServerRequestHandler request_handler, std::size_t thread_pool_size)
HttpServerRequestHandler request_handler_