MySQL 8.4.2
Source Code Documentation
http::server::Server Class Reference

#include <server.h>

Inheritance diagram for http::server::Server:
[legend]

Public Types

using native_handle_type = net::impl::socket::native_handle_type
 
using io_context = net::io_context
 
using socket = net::ip::tcp::socket
 
using Methods = base::method::Bitset
 
using IoThreads = std::list< IoThread >
 
using IoIterator = IoThreads::iterator
 

Public Member Functions

 Server (TlsServerContext *tls_context, IoThreads *threads, Bind *bind_raw, Bind *bind_ssl)
 
void set_allowed_methods (const Methods &methods)
 
void set_request_handler (RequestHandlerInterface *handler)
 
void start ()
 
void stop ()
 

Private Types

enum class  State { kInitializing , kRunning , kStopping , kStopped }
 

Private Member Functions

void on_new_ssl_connection (socket socket)
 
void on_connection_close (ConnectionTls *connection) override
 
void on_connection_io_error (ConnectionTls *connection, const std::error_code &ec) override
 
void on_new_connection (socket socket)
 
void on_connection_close (ConnectionRaw *connection) override
 
void on_connection_io_error (ConnectionRaw *connection, const std::error_code &ec) override
 
size_t disconnect_all ()
 
void start_accepting ()
 
socket socket_move_to_io_thread (socket socket)
 
IoThreadreturn_next_thread ()
 

Private Attributes

TlsServerContexttls_context_
 
std::list< IoThread > * threads_
 
IoIterator current_thread_
 
Bindbind_raw_
 
Bindbind_ssl_
 
base::method::Bitset allowed_methods_
 
RequestHandlerInterfacehandler_ = nullptr
 
std::mutex mutex_connection_
 
std::vector< std::shared_ptr< ServerConnectionRaw > > connections_
 
std::vector< std::shared_ptr< ServerConnectionTls > > connections_ssl_
 
WaitableVariable< Statesync_state_ {State::kInitializing}
 

Member Typedef Documentation

◆ io_context

using http::server::Server::io_context = net::io_context

◆ IoIterator

using http::server::Server::IoIterator = IoThreads::iterator

◆ IoThreads

using http::server::Server::IoThreads = std::list<IoThread>

◆ Methods

using http::server::Server::Methods = base::method::Bitset

◆ native_handle_type

using http::server::Server::native_handle_type = net::impl::socket::native_handle_type

◆ socket

using http::server::Server::socket = net::ip::tcp::socket

Member Enumeration Documentation

◆ State

enum class http::server::Server::State
strongprivate
Enumerator
kInitializing 
kRunning 
kStopping 
kStopped 

Constructor & Destructor Documentation

◆ Server()

http::server::Server::Server ( TlsServerContext tls_context,
IoThreads threads,
Bind bind_raw,
Bind bind_ssl 
)

Member Function Documentation

◆ disconnect_all()

size_t http::server::Server::disconnect_all ( )
private

◆ on_connection_close() [1/2]

void http::server::Server::on_connection_close ( ConnectionRaw connection)
overrideprivate

◆ on_connection_close() [2/2]

void http::server::Server::on_connection_close ( ConnectionTls connection)
overrideprivate

◆ on_connection_io_error() [1/2]

void http::server::Server::on_connection_io_error ( ConnectionRaw connection,
const std::error_code &  ec 
)
overrideprivate

◆ on_connection_io_error() [2/2]

void http::server::Server::on_connection_io_error ( ConnectionTls connection,
const std::error_code &  ec 
)
overrideprivate

◆ on_new_connection()

void http::server::Server::on_new_connection ( socket  socket)
private

◆ on_new_ssl_connection()

void http::server::Server::on_new_ssl_connection ( socket  socket)
private

◆ return_next_thread()

IoThread * http::server::Server::return_next_thread ( )
private

◆ set_allowed_methods()

void http::server::Server::set_allowed_methods ( const Methods methods)

◆ set_request_handler()

void http::server::Server::set_request_handler ( RequestHandlerInterface handler)

◆ socket_move_to_io_thread()

Server::socket http::server::Server::socket_move_to_io_thread ( socket  socket)
private

◆ start()

void http::server::Server::start ( )

◆ start_accepting()

void http::server::Server::start_accepting ( )
private

◆ stop()

void http::server::Server::stop ( )

Member Data Documentation

◆ allowed_methods_

base::method::Bitset http::server::Server::allowed_methods_
private

◆ bind_raw_

Bind* http::server::Server::bind_raw_
private

◆ bind_ssl_

Bind* http::server::Server::bind_ssl_
private

◆ connections_

std::vector<std::shared_ptr<ServerConnectionRaw> > http::server::Server::connections_
private

◆ connections_ssl_

std::vector<std::shared_ptr<ServerConnectionTls> > http::server::Server::connections_ssl_
private

◆ current_thread_

IoIterator http::server::Server::current_thread_
private

◆ handler_

RequestHandlerInterface* http::server::Server::handler_ = nullptr
private

◆ mutex_connection_

std::mutex http::server::Server::mutex_connection_
private

◆ sync_state_

WaitableVariable<State> http::server::Server::sync_state_ {State::kInitializing}
private

◆ threads_

std::list<IoThread>* http::server::Server::threads_
private

◆ tls_context_

TlsServerContext* http::server::Server::tls_context_
private

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