MySQL 8.0.40
Source Code Documentation
|
This interface represents all the communication facilities that a binding implementation should provide. More...
#include <gcs_communication_interface.h>
Public Member Functions | |
virtual enum_gcs_error | send_message (const Gcs_message &message_to_send)=0 |
Method used to broadcast a message to a group in which this interface pertains. More... | |
virtual int | add_event_listener (const Gcs_communication_event_listener &event_listener)=0 |
Registers an implementation of a Gcs_communication_event_listener that will receive Communication Events. More... | |
virtual void | remove_event_listener (int event_listener_handle)=0 |
Removes a previously registered event listener. More... | |
virtual Gcs_protocol_version | get_protocol_version () const =0 |
Retrieves the current GCS protocol version in use. More... | |
virtual std::pair< bool, std::future< void > > | set_protocol_version (Gcs_protocol_version new_version)=0 |
Modifies the GCS protocol version in use. More... | |
virtual Gcs_protocol_version | get_maximum_supported_protocol_version () const =0 |
Get the maximum protocol version currently supported by the group. More... | |
virtual void | set_communication_protocol (enum_transport_protocol protocol)=0 |
Sets the communication protocol to use. More... | |
virtual enum_transport_protocol | get_incoming_connections_protocol ()=0 |
Get the incoming connections protocol which is currently active. More... | |
virtual | ~Gcs_communication_interface ()=default |
This interface represents all the communication facilities that a binding implementation should provide.
Like all interfaces in this API, it is group-oriented, meaning that a single instance shall exist per group, as it was returned by the class Gcs_interface::get_communication_session.
It has two major subsections:
A typical usage for this interface would be:
|
virtualdefault |
|
pure virtual |
Registers an implementation of a Gcs_communication_event_listener that will receive Communication Events.
Note that a binding implementation shall not offer the possibility of changing listeners while the system is up and running. In that sense, listeners must be added to it only when booting up the system.
[in] | event_listener | a class that implements Gcs_communication_event_listener |
Implemented in Gcs_xcom_communication.
|
pure virtual |
Get the incoming connections protocol which is currently active.
Implemented in Gcs_xcom_communication.
|
pure virtual |
Get the maximum protocol version currently supported by the group.
Implemented in Gcs_xcom_communication.
|
pure virtual |
Retrieves the current GCS protocol version in use.
Implemented in Gcs_xcom_communication.
|
pure virtual |
Removes a previously registered event listener.
Note that a binding implementation shall not offer the possibility of changing listeners while the system is up and running. In that sense listeners must be removed from it only when shutting down the system.
[in] | event_listener_handle | the handle returned when the listener was registered |
Implemented in Gcs_xcom_communication.
|
pure virtual |
Method used to broadcast a message to a group in which this interface pertains.
Note that one must belong to an active group to send messages.
[in] | message_to_send | the Gcs_message object to send |
GCS_OK | When message is transmitted successfully |
GCS_ERROR | When error occurred while transmitting message |
GCS_MESSAGE_TOO_BIG | When message is bigger than the GCS can handle |
Implemented in Gcs_xcom_communication.
|
pure virtual |
Sets the communication protocol to use.
protocol | the protocol to use |
Implemented in Gcs_xcom_communication.
|
pure virtual |
Modifies the GCS protocol version in use.
The method is non-blocking. It returns a future on which the caller can wait for the action to finish.
This method has the following requirements:
A GCS client must ensure the requirements are met. In the case of Group Replication, these requirements are ensured by initiating a GCS protocol change as part of a GR group action.
new_version | The desired GCS protocol version |
{true,future} | If successful |
{false,_} | If unsuccessful because new_version is unsupported |
Implemented in Gcs_xcom_communication.