#include <http_server.hpp>
Public Member Functions | |
HttpServer (const std::string &address, const std::string &port, HttpServerRequestHandler request_handler, std::size_t thread_pool_size) | |
void | run () |
void | stop () |
~HttpServer () | |
Private Member Functions | |
void | handle_accept (const boost::system::error_code &e) |
void | start_accept () |
Private Attributes | |
boost::asio::ip::tcp::acceptor | acceptor_ |
boost::asio::io_service | io_service_ |
boost::shared_ptr< HttpConnection > | new_connection_ |
HttpServerRequestHandler | request_handler_ |
std::size_t | thread_pool_size_ |
std::vector< boost::shared_ptr < boost::thread > > | threads_ |
The HttpServer is an implementation of a HTTP server that serves http request from a given port The server maintains a pool of threads to use to serve requests. Each request is dispatched to the given request handler to be handled.
Definition at line 24 of file http_server.hpp.
async_web_server_cpp::HttpServer::HttpServer | ( | const std::string & | address, |
const std::string & | port, | ||
HttpServerRequestHandler | request_handler, | ||
std::size_t | thread_pool_size | ||
) |
Definition at line 7 of file http_server.cpp.
Definition at line 21 of file http_server.cpp.
void async_web_server_cpp::HttpServer::handle_accept | ( | const boost::system::error_code & | e | ) | [private] |
Definition at line 44 of file http_server.cpp.
Definition at line 25 of file http_server.cpp.
void async_web_server_cpp::HttpServer::start_accept | ( | ) | [private] |
Definition at line 36 of file http_server.cpp.
Definition at line 53 of file http_server.cpp.
boost::asio::ip::tcp::acceptor async_web_server_cpp::HttpServer::acceptor_ [private] |
Definition at line 41 of file http_server.hpp.
boost::asio::io_service async_web_server_cpp::HttpServer::io_service_ [private] |
Definition at line 40 of file http_server.hpp.
boost::shared_ptr<HttpConnection> async_web_server_cpp::HttpServer::new_connection_ [private] |
Definition at line 44 of file http_server.hpp.
Definition at line 45 of file http_server.hpp.
std::size_t async_web_server_cpp::HttpServer::thread_pool_size_ [private] |
Definition at line 42 of file http_server.hpp.
std::vector<boost::shared_ptr<boost::thread> > async_web_server_cpp::HttpServer::threads_ [private] |
Definition at line 43 of file http_server.hpp.