MySQL 9.1.0
Source Code Documentation
http::server::Bind Class Reference

#include <bind.h>

Public Types

using io_context = net::io_context
 
using resolver = net::ip::tcp::resolver
 
using acceptor = net::ip::tcp::acceptor
 
using socket_type = acceptor::socket_type
 
using endpoint = acceptor::endpoint_type
 

Public Member Functions

 Bind (io_context *io_context, const std::string &address, const uint16_t port)
 
template<typename Callback >
void start_accepting_loop (Callback callback)
 
void stop_accepting_loop ()
 
endpoint local_endpoint ()
 

Static Public Member Functions

static bool is_not_fatal (const std::error_code &error)
 

Private Types

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

Private Member Functions

template<typename Callback >
void on_new_socket_callback (Callback callback)
 

Private Attributes

io_contextcontext_
 
resolver resolver_ {*context_}
 
acceptor socket_ {*context_}
 
WaitableVariable< Statesync_state_ {State::kInitializing}
 

Member Typedef Documentation

◆ acceptor

using http::server::Bind::acceptor = net::ip::tcp::acceptor

◆ endpoint

using http::server::Bind::endpoint = acceptor::endpoint_type

◆ io_context

using http::server::Bind::io_context = net::io_context

◆ resolver

using http::server::Bind::resolver = net::ip::tcp::resolver

◆ socket_type

using http::server::Bind::socket_type = acceptor::socket_type

Member Enumeration Documentation

◆ State

enum class http::server::Bind::State
strongprivate
Enumerator
kInitializing 
kRunning 
kStopping 
kTerminated 

Constructor & Destructor Documentation

◆ Bind()

http::server::Bind::Bind ( io_context io_context,
const std::string &  address,
const uint16_t  port 
)

Member Function Documentation

◆ is_not_fatal()

static bool http::server::Bind::is_not_fatal ( const std::error_code &  error)
inlinestatic

◆ local_endpoint()

endpoint http::server::Bind::local_endpoint ( )
inline

◆ on_new_socket_callback()

template<typename Callback >
void http::server::Bind::on_new_socket_callback ( Callback  callback)
inlineprivate

◆ start_accepting_loop()

template<typename Callback >
void http::server::Bind::start_accepting_loop ( Callback  callback)
inline

◆ stop_accepting_loop()

void http::server::Bind::stop_accepting_loop ( )
inline

Member Data Documentation

◆ context_

io_context* http::server::Bind::context_
private

◆ resolver_

resolver http::server::Bind::resolver_ {*context_}
private

◆ socket_

acceptor http::server::Bind::socket_ {*context_}
private

◆ sync_state_

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

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