MySQL 8.0.37
Source Code Documentation
HttpServer Class Reference

#include <http_server_plugin.h>

Inheritance diagram for HttpServer:
[legend]

Public Member Functions

 HttpServer (const char *address, uint16_t port)
 
 HttpServer (const HttpServer &)=delete
 
HttpServeroperator= (const HttpServer &)=delete
 
 HttpServer (HttpServer &&)=delete
 
HttpServeroperator= (HttpServer &&)=delete
 
void join_all ()
 
virtual ~HttpServer ()
 
virtual void start (size_t max_threads)
 
void stop ()
 
void add_route (const std::string &url_regex, std::unique_ptr< BaseRequestHandler > cb)
 
void remove_route (const std::string &url_regex)
 
HttpRequestRouterrequest_router ()
 

Protected Attributes

std::vector< HttpRequestThreadthread_contexts_
 
std::string address_
 
uint16_t port_
 
HttpRequestRouter request_router_
 
net::io_context io_ctx_
 
net::ip::tcp::acceptor listen_sock_ {io_ctx_}
 
std::vector< std::thread > sys_threads_
 

Constructor & Destructor Documentation

◆ HttpServer() [1/3]

HttpServer::HttpServer ( const char *  address,
uint16_t  port 
)
inline

◆ HttpServer() [2/3]

HttpServer::HttpServer ( const HttpServer )
delete

◆ HttpServer() [3/3]

HttpServer::HttpServer ( HttpServer &&  )
delete

◆ ~HttpServer()

virtual HttpServer::~HttpServer ( )
inlinevirtual

Member Function Documentation

◆ add_route()

void HttpServer::add_route ( const std::string &  url_regex,
std::unique_ptr< BaseRequestHandler cb 
)

◆ join_all()

void HttpServer::join_all ( )

◆ operator=() [1/2]

HttpServer & HttpServer::operator= ( const HttpServer )
delete

◆ operator=() [2/2]

HttpServer & HttpServer::operator= ( HttpServer &&  )
delete

◆ remove_route()

void HttpServer::remove_route ( const std::string &  url_regex)

◆ request_router()

HttpRequestRouter & HttpServer::request_router ( )
inline

◆ start()

void HttpServer::start ( size_t  max_threads)
virtual

Reimplemented in HttpsServer.

◆ stop()

void HttpServer::stop ( )

Member Data Documentation

◆ address_

std::string HttpServer::address_
protected

◆ io_ctx_

net::io_context HttpServer::io_ctx_
protected

◆ listen_sock_

net::ip::tcp::acceptor HttpServer::listen_sock_ {io_ctx_}
protected

◆ port_

uint16_t HttpServer::port_
protected

◆ request_router_

HttpRequestRouter HttpServer::request_router_
protected

◆ sys_threads_

std::vector<std::thread> HttpServer::sys_threads_
protected

◆ thread_contexts_

std::vector<HttpRequestThread> HttpServer::thread_contexts_
protected

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