MySQL 8.0.39
Source Code Documentation
Shared_mem_listener Class Reference

This class abstract a shared memory listener to listen for connection events that connect via the shared memory. More...

#include <shared_memory_connection.h>

Public Member Functions

 Shared_mem_listener (const std::string *shared_memory_base_name)
 Constructor to create shared memory listener. More...
 
bool setup_listener ()
 Set up a listener. More...
 
Channel_infolisten_for_connection_event ()
 The body of the event loop that listen for connection events from clients. More...
 
bool check_and_spawn_admin_connection_handler_thread () const
 Spawn admin connection handler thread if separate thread is required to accept admin connections. More...
 
void close_listener ()
 Close the listener. More...
 

Private Member Functions

void close_shared_mem ()
 

Private Attributes

std::string m_shared_mem_name
 
HANDLE m_connect_file_map
 
char * m_connect_map
 
HANDLE m_connect_named_mutex
 
HANDLE m_event_connect_request
 
HANDLE m_event_connect_answer
 
SECURITY_ATTRIBUTES * m_sa_event
 
SECURITY_ATTRIBUTES * m_sa_mapping
 
SECURITY_ATTRIBUTES * m_sa_mutex
 
int m_connect_number
 
char * m_suffix_pos
 
char * m_temp_buffer
 
HANDLE m_handle_client_file_map
 
char * m_handle_client_map
 
HANDLE m_event_client_wrote
 
HANDLE m_event_client_read
 
HANDLE m_event_server_wrote
 
HANDLE m_event_server_read
 
HANDLE m_event_conn_closed
 

Detailed Description

This class abstract a shared memory listener to listen for connection events that connect via the shared memory.

Constructor & Destructor Documentation

◆ Shared_mem_listener()

Shared_mem_listener::Shared_mem_listener ( const std::string *  shared_memory_base_name)
inline

Constructor to create shared memory listener.

Parameters
shared_memory_base_namepointer to shared memory base name.

Member Function Documentation

◆ check_and_spawn_admin_connection_handler_thread()

bool Shared_mem_listener::check_and_spawn_admin_connection_handler_thread ( ) const
inline

Spawn admin connection handler thread if separate thread is required to accept admin connections.

Currently we do not support shared memory admin connections. Hence this method is noop.

TODO: Implement for supporting admin connections via shared memory channel.

Returns
false as the method is a NOOP.

◆ close_listener()

void Shared_mem_listener::close_listener ( )

Close the listener.

◆ close_shared_mem()

void Shared_mem_listener::close_shared_mem ( )
private

◆ listen_for_connection_event()

Channel_info * Shared_mem_listener::listen_for_connection_event ( )

The body of the event loop that listen for connection events from clients.

Return values
Channel_infoChannel_info object abstracting the connected client details for processing this connection.

◆ setup_listener()

bool Shared_mem_listener::setup_listener ( )

Set up a listener.

Return values
falselistener listener has been setup successfully to listen for connect events true failure in setting up the listener.

Member Data Documentation

◆ m_connect_file_map

HANDLE Shared_mem_listener::m_connect_file_map
private

◆ m_connect_map

char* Shared_mem_listener::m_connect_map
private

◆ m_connect_named_mutex

HANDLE Shared_mem_listener::m_connect_named_mutex
private

◆ m_connect_number

int Shared_mem_listener::m_connect_number
private

◆ m_event_client_read

HANDLE Shared_mem_listener::m_event_client_read
private

◆ m_event_client_wrote

HANDLE Shared_mem_listener::m_event_client_wrote
private

◆ m_event_conn_closed

HANDLE Shared_mem_listener::m_event_conn_closed
private

◆ m_event_connect_answer

HANDLE Shared_mem_listener::m_event_connect_answer
private

◆ m_event_connect_request

HANDLE Shared_mem_listener::m_event_connect_request
private

◆ m_event_server_read

HANDLE Shared_mem_listener::m_event_server_read
private

◆ m_event_server_wrote

HANDLE Shared_mem_listener::m_event_server_wrote
private

◆ m_handle_client_file_map

HANDLE Shared_mem_listener::m_handle_client_file_map
private

◆ m_handle_client_map

char* Shared_mem_listener::m_handle_client_map
private

◆ m_sa_event

SECURITY_ATTRIBUTES* Shared_mem_listener::m_sa_event
private

◆ m_sa_mapping

SECURITY_ATTRIBUTES* Shared_mem_listener::m_sa_mapping
private

◆ m_sa_mutex

SECURITY_ATTRIBUTES* Shared_mem_listener::m_sa_mutex
private

◆ m_shared_mem_name

std::string Shared_mem_listener::m_shared_mem_name
private

◆ m_suffix_pos

char* Shared_mem_listener::m_suffix_pos
private

◆ m_temp_buffer

char* Shared_mem_listener::m_temp_buffer
private

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