MySQL 8.4.2
Source Code Documentation
Connection_acceptor< Listener > Class Template Reference

This class presents a generic interface to initialize and run a connection event loop for different types of listeners and a callback functor to call on the connection event from the listener that listens for connection. More...

#include <connection_acceptor.h>

Public Member Functions

 Connection_acceptor (Listener *listener)
 
 ~Connection_acceptor ()
 
bool init_connection_acceptor ()
 Initialize a connection acceptor. More...
 
void connection_event_loop ()
 Connection acceptor loop to accept connections from clients. More...
 
bool check_and_spawn_admin_connection_handler_thread () const
 Spawn admin connection handler to accept admin connections from clients if create-admin-listener-thread is specified by user on commandline. More...
 
void close_listener ()
 Close the listener. More...
 

Private Attributes

Listener * m_listener
 

Detailed Description

template<typename Listener>
class Connection_acceptor< Listener >

This class presents a generic interface to initialize and run a connection event loop for different types of listeners and a callback functor to call on the connection event from the listener that listens for connection.

Listener type should be a class providing methods setup_listener, listen_for_ connection_event and close_listener. The Connection event callback functor object would on receiving connection event from the client to process the connection.

Constructor & Destructor Documentation

◆ Connection_acceptor()

template<typename Listener >
Connection_acceptor< Listener >::Connection_acceptor ( Listener *  listener)
inline

◆ ~Connection_acceptor()

template<typename Listener >
Connection_acceptor< Listener >::~Connection_acceptor ( )
inline

Member Function Documentation

◆ check_and_spawn_admin_connection_handler_thread()

template<typename Listener >
bool Connection_acceptor< Listener >::check_and_spawn_admin_connection_handler_thread ( ) const
inline

Spawn admin connection handler to accept admin connections from clients if create-admin-listener-thread is specified by user on commandline.

Returns
true unable to spawn admin connection handler thread else false.

◆ close_listener()

template<typename Listener >
void Connection_acceptor< Listener >::close_listener ( )
inline

Close the listener.

◆ connection_event_loop()

template<typename Listener >
void Connection_acceptor< Listener >::connection_event_loop ( )
inline

Connection acceptor loop to accept connections from clients.

◆ init_connection_acceptor()

template<typename Listener >
bool Connection_acceptor< Listener >::init_connection_acceptor ( )
inline

Initialize a connection acceptor.

Return values
returntrue if initialization failed, else false.

Member Data Documentation

◆ m_listener

template<typename Listener >
Listener* Connection_acceptor< Listener >::m_listener
private

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