MySQL 8.4.2
Source Code Documentation
|
Main class. More...
#include <mysql_server_mock.h>
Public Member Functions | |
MySQLServerMock (net::io_context &io_ctx, std::string expected_queries_file, std::vector< std::string > module_prefixes, std::string bind_address, unsigned bind_port, std::string protocol, bool debug_mode, TlsServerContext &&tls_server_ctx, mysql_ssl_mode ssl_mode) | |
Constructor. More... | |
void | run (mysql_harness::PluginFuncEnv *env) |
Starts handling the clients connections in infinite loop. More... | |
void | close_all_connections () |
close all open connections. More... | |
Private Attributes | |
std::string | bind_address_ |
unsigned | bind_port_ |
bool | debug_mode_ |
net::io_context & | io_ctx_ |
std::string | expected_queries_file_ |
std::vector< std::string > | module_prefixes_ |
std::string | protocol_name_ |
TlsServerContext | tls_server_ctx_ |
mysql_ssl_mode | ssl_mode_ |
WaitableMonitor< std::list< std::unique_ptr< MySQLServerMockSession > > > | client_sessions_ {{}} |
Main class.
Responsible for accepting and handling client's connections.
server_mock::MySQLServerMock::MySQLServerMock | ( | net::io_context & | io_ctx, |
std::string | expected_queries_file, | ||
std::vector< std::string > | module_prefixes, | ||
std::string | bind_address, | ||
unsigned | bind_port, | ||
std::string | protocol, | ||
bool | debug_mode, | ||
TlsServerContext && | tls_server_ctx, | ||
mysql_ssl_mode | ssl_mode | ||
) |
Constructor.
io_ctx | IO context for network operations |
expected_queries_file | Path to the json file with definitins of the expected SQL statements and responses |
module_prefixes | prefixes of javascript modules used by the nodejs compatible module-loader |
bind_address | Address on which the server accepts client connections |
bind_port | Number of the port on which the server accepts clients connections |
protocol | the protocol this mock instance speaks: "x" or "classic" |
debug_mode | Flag indicating if the handled queries should be printed to the standard output |
tls_server_ctx | TLS Server Context |
ssl_mode | SSL mode |
void server_mock::MySQLServerMock::close_all_connections | ( | ) |
close all open connections.
can be called from other threads.
void server_mock::MySQLServerMock::run | ( | mysql_harness::PluginFuncEnv * | env | ) |
Starts handling the clients connections in infinite loop.
Will return only in case of an exception (error).
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |