MySQL 8.0.39
Source Code Documentation
|
#include <classic_connection_base.h>
Public Types | |
enum class | FromEither { None , Started , RecvedFromClient , RecvedFromServer } |
Public Types inherited from MySQLRoutingConnectionBase | |
using | clock_type = std::chrono::system_clock |
using | time_point_type = clock_type::time_point |
Public Member Functions | |
std::shared_ptr< MysqlRoutingClassicConnectionBase > | getptr () |
void | on_handshake_received () |
void | on_handshake_aborted () |
SslMode | source_ssl_mode () const |
SslMode | dest_ssl_mode () const |
std::string | get_client_address () const override |
Returns address of client which connected to router. More... | |
std::string | get_server_address () const override |
Returns address of server to which connection is established. More... | |
void | disconnect () override |
virtual void | async_run () |
void | send_server_failed (std::error_code ec, bool call_finish=true) |
void | recv_server_failed (std::error_code ec, bool call_finish=true) |
void | send_client_failed (std::error_code ec, bool call_finish=true) |
void | recv_client_failed (std::error_code ec, bool call_finish=true) |
void | server_socket_failed (std::error_code ec, bool call_finish=true) |
virtual void | client_socket_failed (std::error_code ec, bool call_finish=true) |
void | resume () |
void | push_processor (std::unique_ptr< BasicProcessor > processor) |
void | pop_processor () |
stdx::expected< void, std::error_code > | track_session_changes (net::const_buffer session_trackers, classic_protocol::capabilities::value_type caps, bool ignore_some_state_changed=false) |
ClassicProtocolState * | client_protocol () |
const ClassicProtocolState * | client_protocol () const |
ClassicProtocolState * | server_protocol () |
const ClassicProtocolState * | server_protocol () const |
const ProtocolSplicerBase * | socket_splicer () const |
ProtocolSplicerBase * | socket_splicer () |
std::string | get_destination_id () const override |
void | destination_id (const std::string &id) |
bool | authenticated () const |
check if the connection is authenticated. More... | |
void | authenticated (bool v) |
bool | connection_sharing_possible () const |
check if connection sharing is possible. More... | |
bool | connection_sharing_allowed () const |
check if connection sharing is allowed. More... | |
void | connection_sharing_allowed_reset () |
reset the connection-sharing state. More... | |
bool | greeting_from_router () const |
if the router is sending the initial server-greeting. More... | |
void | requires_tls (bool v) |
bool | requires_tls () const |
void | some_state_changed (bool v) |
RouteDestination * | destinations () |
Destinations & | current_destinations () |
void | collation_connection_maybe_dirty (bool val) |
bool | collation_connection_maybe_dirty () const |
ExecutionContext & | execution_context () |
const ExecutionContext & | execution_context () const |
void | trace (Tracer::Event e) |
Tracer & | tracer () |
net::steady_timer & | read_timer () |
net::steady_timer & | connect_timer () |
void | connect_error_code (const std::error_code &ec) |
std::error_code | connect_error_code () const |
void | diagnostic_area_changed (bool diagnostic_area_changed) |
bool | diagnostic_area_changed () const |
void | recv_from_either (FromEither v) |
FromEither | recv_from_either () const |
Public Member Functions inherited from MySQLRoutingConnectionBase | |
MySQLRoutingConnectionBase (MySQLRoutingContext &context, std::function< void(MySQLRoutingConnectionBase *)> remove_callback) | |
virtual | ~MySQLRoutingConnectionBase ()=default |
MySQLRoutingContext & | context () |
const MySQLRoutingContext & | context () const |
std::size_t | get_bytes_up () const |
std::size_t | get_bytes_down () const |
time_point_type | get_started () const |
time_point_type | get_connected_to_server () const |
time_point_type | get_last_sent_to_server () const |
time_point_type | get_last_received_from_server () const |
Stats | get_stats () const |
void | transfered_to_server (size_t bytes) |
void | transfered_to_client (size_t bytes) |
void | disassociate () |
void | accepted () |
virtual void | connected () |
template<class F > | |
auto | disconnect_request (F &&f) |
bool | disconnect_requested () const |
Static Public Member Functions | |
template<typename... Args> | |
static std::shared_ptr< MysqlRoutingClassicConnectionBase > | create (Args &&... args) |
static stdx::expected< size_t, std::error_code > | encode_error_packet (std::vector< uint8_t > &error_frame, const uint8_t seq_id, const classic_protocol::capabilities::value_type caps, const uint16_t error_code, const std::string &msg, const std::string &sql_state) |
Protected Types | |
enum class | Function { kLoop , kFinish } |
Protected Member Functions | |
MysqlRoutingClassicConnectionBase (MySQLRoutingContext &context, RouteDestination *route_destination, std::unique_ptr< ConnectionBase > client_connection, std::unique_ptr< RoutingConnectionBase > client_routing_connection, std::function< void(MySQLRoutingConnectionBase *)> remove_callback) | |
void | call_next_function (Function next) |
Private Member Functions | |
void | trace_and_call_function (Tracer::Event::Direction dir, std::string_view stage, Function func) |
void | async_send_client (Function next) |
void | async_recv_client (Function next) |
void | async_send_server (Function next) |
void | async_recv_server (Function next) |
void | async_recv_both (Function next) |
void | async_send_client_and_finish () |
void | async_wait_client_closed () |
void | async_wait_send_server (Function next) |
void | server_side_client_greeting () |
void | loop () |
void | finish () |
virtual void | done () |
Private Attributes | |
std::vector< std::unique_ptr< BasicProcessor > > | processors_ |
int | active_work_ {0} |
bool | authenticated_ {false} |
RouteDestination * | route_destination_ |
Destinations | destinations_ |
std::unique_ptr< ProtocolSplicerBase > | socket_splicer_ |
std::string | destination_id_ |
bool | in_handshake_ {true} |
client side handshake isn't finished yet. More... | |
std::optional< classic_protocol::session_track::TransactionState > | trx_state_ |
std::optional< classic_protocol::session_track::TransactionCharacteristics > | trx_characteristics_ |
bool | some_state_changed_ {false} |
bool | collation_connection_maybe_dirty_ {false} |
bool | requires_tls_ {true} |
ExecutionContext | exec_ctx_ |
Tracer | tracer_ {false} |
net::steady_timer | read_timer_ |
net::steady_timer | connect_timer_ |
std::error_code | connect_ec_ {} |
bool | diagnostic_area_changed_ {} |
FromEither | recv_from_either_ {FromEither::None} |
Additional Inherited Members | |
Protected Attributes inherited from MySQLRoutingConnectionBase | |
MySQLRoutingContext & | context_ |
wrapper for common data used by all routing threads More... | |
std::function< void(MySQLRoutingConnectionBase *)> | remove_callback_ |
callback that is called when thread of execution completes More... | |
Monitor< Stats > | stats_ {{}} |
Monitor< bool > | disconnect_ {{}} |
|
strong |
|
strongprotected |
|
inlineprotected |
|
private |
|
private |
|
private |
|
inlinevirtual |
Reimplemented in MysqlRoutingClassicConnection.
|
private |
|
private |
|
private |
|
private |
|
private |
|
inline |
check if the connection is authenticated.
'true' after the initial handshake and change-user finished with "ok". 'false' at connection start and after change-user is started.
true | if the connection is authenticated. |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
virtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool MysqlRoutingClassicConnectionBase::connection_sharing_allowed | ( | ) | const |
check if connection sharing is allowed.
void MysqlRoutingClassicConnectionBase::connection_sharing_allowed_reset | ( | ) |
reset the connection-sharing state.
bool MysqlRoutingClassicConnectionBase::connection_sharing_possible | ( | ) | const |
check if connection sharing is possible.
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Implements MySQLRoutingConnectionBase.
|
privatevirtual |
|
static |
|
inline |
|
inline |
|
private |
|
inlineoverridevirtual |
Returns address of client which connected to router.
Implements MySQLRoutingConnectionBase.
|
inlineoverridevirtual |
Implements MySQLRoutingConnectionBase.
|
inlineoverridevirtual |
Returns address of server to which connection is established.
Implements MySQLRoutingConnectionBase.
|
inline |
|
inline |
if the router is sending the initial server-greeting.
if true, the router sends the initial greeting to the client, if false, the server is sending the initial greeting and router is forward it.
|
private |
void MysqlRoutingClassicConnectionBase::on_handshake_aborted | ( | ) |
void MysqlRoutingClassicConnectionBase::on_handshake_received | ( | ) |
|
inline |
|
inline |
|
inline |
void MysqlRoutingClassicConnectionBase::recv_client_failed | ( | std::error_code | ec, |
bool | call_finish = true |
||
) |
|
inline |
|
inline |
void MysqlRoutingClassicConnectionBase::recv_server_failed | ( | std::error_code | ec, |
bool | call_finish = true |
||
) |
|
inline |
|
inline |
|
inline |
void MysqlRoutingClassicConnectionBase::send_client_failed | ( | std::error_code | ec, |
bool | call_finish = true |
||
) |
void MysqlRoutingClassicConnectionBase::send_server_failed | ( | std::error_code | ec, |
bool | call_finish = true |
||
) |
|
inline |
|
inline |
|
private |
void MysqlRoutingClassicConnectionBase::server_socket_failed | ( | std::error_code | ec, |
bool | call_finish = true |
||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
inline |
stdx::expected< void, std::error_code > MysqlRoutingClassicConnectionBase::track_session_changes | ( | net::const_buffer | session_trackers, |
classic_protocol::capabilities::value_type | caps, | ||
bool | ignore_some_state_changed = false |
||
) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
client side handshake isn't finished yet.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |