MySQL 9.1.0
Source Code Documentation
|
This class represents the Mysqld_socket_listener which prepares the listener sockets to receive connection events from the client. More...
#include <socket_connection.h>
Classes | |
struct | poll_info_t |
Public Member Functions | |
Mysqld_socket_listener (const std::list< Bind_address_info > &bind_addresses, uint tcp_port, const Bind_address_info &admin_bind_addr, uint admin_tcp_port, bool use_separate_thread_for_admin, uint backlog, uint port_timeout, std::string unix_sockname) | |
Constructor to setup a listener for listen to connect events from clients. More... | |
bool | setup_listener () |
Set up a listener - set of sockets to listen for connection events from clients. More... | |
Channel_info * | listen_for_connection_event () |
The body of the event loop that listen for connection events from clients. More... | |
void | close_listener () |
Close the listener. More... | |
~Mysqld_socket_listener () | |
bool | check_and_spawn_admin_connection_handler_thread () const |
Spawn admin connection handler thread if separate thread is required to accept admin connections. More... | |
Private Member Functions | |
void | add_socket_to_listener (MYSQL_SOCKET listen_socket) |
Add a socket to a set of sockets being waiting for a new connection request. More... | |
const Listen_socket * | get_listen_socket () const |
Get a socket ready to accept incoming connection. More... | |
void | setup_connection_events (const socket_vector_t &socket_vector) |
Set up connection events for poll or select. More... | |
Private Attributes | |
std::list< Bind_address_info > | m_bind_addresses |
Bind_address_info | m_admin_bind_address |
uint | m_tcp_port |
uint | m_admin_tcp_port |
bool | m_use_separate_thread_for_admin |
uint | m_backlog |
uint | m_port_timeout |
std::string | m_unix_sockname |
bool | m_unlink_sockname |
socket_vector_t | m_socket_vector |
MYSQL_SOCKET | m_admin_interface_listen_socket |
poll_info_t | m_poll_info |
This class represents the Mysqld_socket_listener which prepares the listener sockets to receive connection events from the client.
The Mysqld_socket_listener may be composed of either or both a tcp socket which listens on a default mysqld tcp port or a user specified port via mysqld command-line and a unix socket which is bound to a mysqld default pathname.
Mysqld_socket_listener::Mysqld_socket_listener | ( | const std::list< Bind_address_info > & | bind_addresses, |
uint | tcp_port, | ||
const Bind_address_info & | admin_bind_addr, | ||
uint | admin_tcp_port, | ||
bool | use_separate_thread_for_admin, | ||
uint | backlog, | ||
uint | port_timeout, | ||
std::string | unix_sockname | ||
) |
Constructor to setup a listener for listen to connect events from clients.
bind_addresses | list of addresses to listen to |
tcp_port | TCP port to bind to |
admin_bind_addr | address to listen admin connection |
admin_tcp_port | TCP port for admin connection to bind |
use_separate_thread_for_admin | Listen to connection requests on admin interface in a separate thread |
backlog | backlog specifying length of pending connection queue used in listen. |
port_timeout | portname. |
unix_sockname | pathname for unix socket to bind to |
|
inline |
|
private |
Add a socket to a set of sockets being waiting for a new connection request.
listen_socket | Socket to listen for. |
bool Mysqld_socket_listener::check_and_spawn_admin_connection_handler_thread | ( | ) | const |
Spawn admin connection handler thread if separate thread is required to accept admin connections.
void Mysqld_socket_listener::close_listener | ( | ) |
Close the listener.
In case a server is started with the option use_separate_thread_for_admin=true this method also shutdowns a thread for handling of incoming connection requests on admin interface and joins it.
|
private |
Get a socket ready to accept incoming connection.
Channel_info * Mysqld_socket_listener::listen_for_connection_event | ( | ) |
The body of the event loop that listen for connection events from clients.
Channel_info | Channel_info object abstracting the connected client details for processing this connection. |
|
private |
Set up connection events for poll or select.
socket_vector | sockets to listen for connection requests. |
bool Mysqld_socket_listener::setup_listener | ( | ) |
Set up a listener - set of sockets to listen for connection events from clients.
In case a server is started with the option use_separate_thread_for_admin=true invocation of this method also spawns a thread to handle incoming connection requests on admin interface.
false | listener sockets setup to be used to listen for connect events true failure in setting up the listener. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |