TARAXA
taraxa::net::HttpServer Class Reference

#include <http_server.hpp>

Collaboration diagram for taraxa::net::HttpServer:

Public Member Functions

 HttpServer (boost::asio::io_context &io, boost::asio::ip::tcp::endpoint ep, const addr_t &node_addr, const std::shared_ptr< HttpProcessor > &request_processor)
 
virtual ~HttpServer ()
 
bool start ()
 
bool stop ()
 
void accept ()
 
boost::asio::io_context & getIoContext ()
 
std::shared_ptr< HttpServergetShared ()
 
std::shared_ptr< HttpConnectioncreateConnection ()
 

Public Attributes

friend HttpConnection
 
friend HttpHandler
 

Protected Attributes

std::shared_ptr< HttpProcessorrequest_processor_
 

Private Attributes

std::atomic< bool > stopped_ = true
 
boost::asio::io_context & io_context_
 
boost::asio::ip::tcp::acceptor acceptor_
 
boost::asio::ip::tcp::endpoint ep_
 

Constructor & Destructor Documentation

◆ HttpServer()

taraxa::net::HttpServer::HttpServer ( boost::asio::io_context &  io,
boost::asio::ip::tcp::endpoint  ep,
const addr_t node_addr,
const std::shared_ptr< HttpProcessor > &  request_processor 
)

◆ ~HttpServer()

virtual taraxa::net::HttpServer::~HttpServer ( )
inlinevirtual

Member Function Documentation

◆ accept()

void taraxa::net::HttpServer::accept ( )

◆ createConnection()

std::shared_ptr< HttpConnection > taraxa::net::HttpServer::createConnection ( )

◆ getIoContext()

boost::asio::io_context& taraxa::net::HttpServer::getIoContext ( )
inline

◆ getShared()

std::shared_ptr< HttpServer > taraxa::net::HttpServer::getShared ( )

◆ start()

bool taraxa::net::HttpServer::start ( )

◆ stop()

bool taraxa::net::HttpServer::stop ( )

Member Data Documentation

◆ acceptor_

boost::asio::ip::tcp::acceptor taraxa::net::HttpServer::acceptor_
private

◆ ep_

boost::asio::ip::tcp::endpoint taraxa::net::HttpServer::ep_
private

◆ HttpConnection

friend taraxa::net::HttpServer::HttpConnection

◆ HttpHandler

friend taraxa::net::HttpServer::HttpHandler

◆ io_context_

boost::asio::io_context& taraxa::net::HttpServer::io_context_
private

◆ request_processor_

std::shared_ptr<HttpProcessor> taraxa::net::HttpServer::request_processor_
protected

◆ stopped_

std::atomic<bool> taraxa::net::HttpServer::stopped_ = true
private

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