MySQL 9.1.0
Source Code Documentation
Connector< ConnectionType > Class Template Reference

#include <connection.h>

Inheritance diagram for Connector< ConnectionType >:
[legend]

Public Member Functions

stdx::expected< ConnectionType, std::error_code > connect ()
 
 ConnectorBase (net::io_context &io_ctx, RouteDestination *route_destination, Destinations &destinations)
 
- Public Member Functions inherited from ConnectorBase
 ConnectorBase (net::io_context &io_ctx, RouteDestination *route_destination, Destinations &destinations)
 
server_protocol_type::socketsocket ()
 
server_protocol_type::endpointendpoint ()
 
net::steady_timertimer ()
 
void connect_timed_out (bool v)
 
bool connect_timed_out () const
 
void destination_id (std::string id)
 
std::string destination_id () const
 
void on_connect_failure (std::function< void(std::string, uint16_t, std::error_code)> func)
 
void on_connect_success (std::function< void(std::string, uint16_t)> func)
 
void on_is_destination_good (std::function< bool(std::string, uint16_t)> func)
 
bool is_destination_good (const std::string &hostname, uint16_t port) const
 

Additional Inherited Members

- Public Types inherited from ConnectorBase
enum class  Function { kInitDestination , kConnectFinish }
 
using server_protocol_type = net::ip::tcp
 
- Protected Member Functions inherited from ConnectorBase
stdx::expected< void, std::error_code > resolve ()
 
stdx::expected< void, std::error_code > init_destination ()
 
stdx::expected< void, std::error_code > init_endpoint ()
 
stdx::expected< void, std::error_code > next_endpoint ()
 
stdx::expected< void, std::error_code > next_destination ()
 
stdx::expected< void, std::error_code > connect_init ()
 
stdx::expected< void, std::error_code > try_connect ()
 
stdx::expected< void, std::error_code > connect_finish ()
 
stdx::expected< void, std::error_code > connected ()
 
stdx::expected< void, std::error_code > connect_failed (std::error_code ec)
 
- Protected Attributes inherited from ConnectorBase
net::io_contextio_ctx_
 
net::ip::tcp::resolver resolver_ {io_ctx_}
 
server_protocol_type::socket server_sock_ {io_ctx_}
 
server_protocol_type::endpoint server_endpoint_
 
RouteDestinationroute_destination_
 
Destinationsdestinations_
 
Destinations::iterator destinations_it_
 
net::ip::tcp::resolver::results_type endpoints_
 
net::ip::tcp::resolver::results_type::iterator endpoints_it_
 
std::error_code last_ec_ {make_error_code(DestinationsErrc::kNotSet)}
 
Function func_ {Function::kInitDestination}
 
net::steady_timer connect_timer_ {io_ctx_}
 
bool connect_timed_out_ {false}
 
std::string destination_id_
 
std::function< void(std::string, uint16_t, std::error_code)> on_connect_failure_
 
std::function< void(std::string, uint16_t)> on_connect_success_
 
std::function< bool(std::string, uint16_t)> on_is_destination_good_
 

Member Function Documentation

◆ connect()

template<class ConnectionType >
stdx::expected< ConnectionType, std::error_code > Connector< ConnectionType >::connect ( )
inline

◆ ConnectorBase()

template<class ConnectionType >
ConnectorBase::ConnectorBase ( net::io_context io_ctx,
RouteDestination route_destination,
Destinations destinations 
)
inline

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