Public Member Functions | Private Member Functions | Private Attributes | List of all members
async_web_server_cpp::HttpServer Class Reference

#include <http_server.hpp>

Inheritance diagram for async_web_server_cpp::HttpServer:
Inheritance graph
[legend]

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< HttpConnectionnew_connection_
 
HttpServerRequestHandler request_handler_
 
std::size_t thread_pool_size_
 
std::vector< boost::shared_ptr< boost::thread > > threads_
 

Detailed Description

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 26 of file http_server.hpp.

Constructor & Destructor Documentation

◆ HttpServer()

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 8 of file http_server.cpp.

◆ ~HttpServer()

async_web_server_cpp::HttpServer::~HttpServer ( )

Definition at line 25 of file http_server.cpp.

Member Function Documentation

◆ handle_accept()

void async_web_server_cpp::HttpServer::handle_accept ( const boost::system::error_code &  e)
private

Definition at line 49 of file http_server.cpp.

◆ run()

void async_web_server_cpp::HttpServer::run ( )

Definition at line 30 of file http_server.cpp.

◆ start_accept()

void async_web_server_cpp::HttpServer::start_accept ( )
private

Definition at line 41 of file http_server.cpp.

◆ stop()

void async_web_server_cpp::HttpServer::stop ( )

Definition at line 58 of file http_server.cpp.

Member Data Documentation

◆ acceptor_

boost::asio::ip::tcp::acceptor async_web_server_cpp::HttpServer::acceptor_
private

Definition at line 44 of file http_server.hpp.

◆ io_service_

boost::asio::io_service async_web_server_cpp::HttpServer::io_service_
private

Definition at line 43 of file http_server.hpp.

◆ new_connection_

boost::shared_ptr<HttpConnection> async_web_server_cpp::HttpServer::new_connection_
private

Definition at line 47 of file http_server.hpp.

◆ request_handler_

HttpServerRequestHandler async_web_server_cpp::HttpServer::request_handler_
private

Definition at line 48 of file http_server.hpp.

◆ thread_pool_size_

std::size_t async_web_server_cpp::HttpServer::thread_pool_size_
private

Definition at line 45 of file http_server.hpp.

◆ threads_

std::vector<boost::shared_ptr<boost::thread> > async_web_server_cpp::HttpServer::threads_
private

Definition at line 46 of file http_server.hpp.


The documentation for this class was generated from the following files:


async_web_server_cpp
Author(s): Mitchell Wills , Russel Toris
autogenerated on Tue Mar 1 2022 23:49:07