![]() |
MySQL 26.10.0
Source Code Documentation
|
Base class for External Network Providers. More...
#include <network_provider.h>
Public Member Functions | |
| Network_provider () | |
| Network_provider (Network_provider &¶m) | |
| Network_provider & | operator= (Network_provider ¶m)=delete |
| Network_provider (Network_provider ¶m)=delete | |
| virtual | ~Network_provider () |
| virtual std::pair< bool, int > | start ()=0 |
| Starts the network provider. More... | |
| virtual std::pair< bool, int > | stop ()=0 |
| Stops the network provider. More... | |
| virtual enum_transport_protocol | get_communication_stack () const =0 |
| Get the communication stack implemented by this provider. More... | |
| virtual bool | configure (const Network_configuration_parameters ¶ms)=0 |
| Configures a network provider. More... | |
| virtual bool | configure_secure_connections (const Network_configuration_parameters ¶ms)=0 |
| Configures the active provider with all things needed to establish SSL connections. More... | |
| virtual void | cleanup_secure_connections_context ()=0 |
| virtual std::function< void()> | get_secure_connections_context_cleaner () |
| virtual bool | finalize_secure_connections_context ()=0 |
| virtual std::unique_ptr< Network_connection > | open_connection (const std::string &address, const unsigned short port, const Network_security_credentials &security_credentials, int connection_timeout=default_connection_timeout(), network_provider_dynamic_log_level log_level=network_provider_dynamic_log_level::PROVIDED)=0 |
| Opens a new connection to another XCom endpoint served by the same Network provider. More... | |
| virtual int | close_connection (const Network_connection &connection)=0 |
| Closes an open connection to another XCom endpoint served by the same Network provider. More... | |
| Network_connection_handoff_status | set_new_connection (Network_connection *connection) |
| Publish a connection for XCom. More... | |
| Network_connection * | get_new_connection () |
| Consume the pending connection. More... | |
| void | reset_new_connection () |
Static Public Member Functions | |
| static constexpr int | default_connection_timeout () |
Private Attributes | |
| std::atomic< Network_connection * > | m_shared_connection |
| Single pending connection handoff slot. More... | |
Base class for External Network Providers.
This virtual class will serve as base class for any external entity that whishes to provide network connections to XCom.
It will have to implement the following methods:
It provides a lock-free, single-slot handoff between a network provider and the XCom incoming connection task. Only one unconsumed connection can be pending per provider. Connections already consumed by XCom are no longer represented by this slot and may remain active concurrently.
|
inline |
|
inline |
|
delete |
|
inlinevirtual |
|
pure virtual |
Implemented in Gcs_mysql_network_provider, and Xcom_network_provider.
|
pure virtual |
Closes an open connection to another XCom endpoint served by the same Network provider.
| connection | an open and valid connection |
Implemented in Gcs_mysql_network_provider, and Xcom_network_provider.
|
pure virtual |
Configures a network provider.
| params | a sensible list of possibly configurable network parameters |
Implemented in Gcs_mysql_network_provider, and Xcom_network_provider.
|
pure virtual |
Configures the active provider with all things needed to establish SSL connections.
| params | configuration parameters for SSL. |
Implemented in Gcs_mysql_network_provider, and Xcom_network_provider.
|
inlinestaticconstexpr |
|
pure virtual |
Implemented in Gcs_mysql_network_provider, and Xcom_network_provider.
|
pure virtual |
Get the communication stack implemented by this provider.
Return a valid value withint the range of RunningProtocol enum.
Implemented in Gcs_mysql_network_provider, and Xcom_network_provider.
|
inline |
Consume the pending connection.
Atomically removes the connection from the handoff slot and transfers ownership to the caller.
|
inlinevirtual |
|
pure virtual |
Opens a new connection to another XCom endpoint served by the same Network provider.
| address | address of the remote endpoint |
| port | port of the remote endpoint |
| security_credentials | security credentials to connect to the remote endpoint |
| connection_timeout | connection timeout |
| log_level | log level |
Implemented in Gcs_mysql_network_provider, and Xcom_network_provider.
|
delete |
|
inline |
|
inline |
Publish a connection for XCom.
Publishes a new connection received by this provider through a single pending handoff slot. The XCom incoming connection task consumes it later through get_new_connection(). This slot does not queue multiple pending connections.
| connection | a newly created connection. |
| Network_connection_handoff_status::ACCEPTED | the connection was accepted. |
| Network_connection_handoff_status::BUSY | the handoff slot was occupied and ownership remains with the caller. |
|
pure virtual |
Starts the network provider.
Each implementation will place here any code that it needs to start a network provider.
start() is synchronous. After start() succeeded, it is assumed that XCom is ready to receive new connections.
Implemented in Gcs_mysql_network_provider, and Xcom_network_provider.
|
pure virtual |
Stops the network provider.
Each implementation will place here any code that it needs to stop a network provider.
stop() is synchronous. After stop() succeeded, it is assumed that XCom shall not receive any new connection.
Implemented in Gcs_mysql_network_provider, and Xcom_network_provider.
|
private |
Single pending connection handoff slot.