MySQL 8.0.40
Source Code Documentation
ConnectProcessor Class Reference

#include <classic_connect.h>

Inheritance diagram for ConnectProcessor:
[legend]

Public Types

enum class  Stage {
  InitDestination , Resolve , InitEndpoint , NextEndpoint ,
  NextDestination , InitConnect , FromPool , Connect ,
  ConnectFinish , Connected , Error , Done
}
 
using server_protocol_type = net::ip::tcp
 
- Public Types inherited from BasicProcessor
enum class  Result {
  Again , RecvFromClient , SendToClient , RecvFromServer ,
  RecvFromBoth , SendToServer , SendableToServer , Suspend ,
  Done , Void
}
 

Public Member Functions

 ConnectProcessor (MysqlRoutingClassicConnectionBase *conn, std::function< void(const classic_protocol::message::server::Error &err)> on_error)
 
stdx::expected< Processor::Result, std::error_code > process () override
 
void stage (Stage stage)
 
Stage stage () const
 
bool is_destination_good (const std::string &hostname, uint16_t port) const
 
- Public Member Functions inherited from Processor
 BasicProcessor (MysqlRoutingClassicConnectionBase *conn)
 
- Public Member Functions inherited from BasicProcessor
 BasicProcessor (MysqlRoutingClassicConnectionBase *conn)
 
virtual ~BasicProcessor ()=default
 
const MysqlRoutingClassicConnectionBaseconnection () const
 
MysqlRoutingClassicConnectionBaseconnection ()
 

Private Member Functions

stdx::expected< Processor::Result, std::error_code > init_destination ()
 
stdx::expected< Processor::Result, std::error_code > resolve ()
 
stdx::expected< Processor::Result, std::error_code > init_endpoint ()
 
stdx::expected< Processor::Result, std::error_code > next_endpoint ()
 
stdx::expected< Processor::Result, std::error_code > next_destination ()
 
stdx::expected< Processor::Result, std::error_code > init_connect ()
 
stdx::expected< Processor::Result, std::error_code > from_pool ()
 
stdx::expected< Processor::Result, std::error_code > connect ()
 
stdx::expected< Processor::Result, std::error_code > connect_finish ()
 
stdx::expected< Processor::Result, std::error_code > connected ()
 
stdx::expected< Processor::Result, std::error_code > error ()
 

Private Attributes

Stage stage_ {Stage::InitDestination}
 
net::io_contextio_ctx_
 
net::ip::tcp::resolver resolver_ {io_ctx_}
 
server_protocol_type::endpoint server_endpoint_
 
Destinationsdestinations_
 
Destinations::iterator destinations_it_
 
net::ip::tcp::resolver::results_type endpoints_
 
net::ip::tcp::resolver::results_type::iterator endpoints_it_
 
bool all_quarantined_ {false}
 
std::error_code destination_ec_
 
std::vector< std::pair< std::string, std::error_code > > connect_errors_
 
std::function< void(const classic_protocol::message::server::Error &err)> on_error_
 
std::chrono::steady_clock::time_point connect_started_
 

Additional Inherited Members

- Protected Member Functions inherited from Processor
stdx::expected< Result, std::error_code > send_server_failed (std::error_code ec)
 
stdx::expected< Result, std::error_code > recv_server_failed (std::error_code ec)
 
stdx::expected< Result, std::error_code > send_client_failed (std::error_code ec)
 
stdx::expected< Result, std::error_code > recv_client_failed (std::error_code ec)
 
stdx::expected< Result, std::error_code > server_socket_failed (std::error_code ec)
 
stdx::expected< Result, std::error_code > client_socket_failed (std::error_code ec)
 
stdx::expected< void, std::error_code > discard_current_msg (Channel *src_channel, ClassicProtocolState *src_protocol)
 discard to current message. More...
 
void trace (Tracer::Event e)
 
Tracertracer ()
 
- Static Protected Member Functions inherited from Processor
static void log_fatal_error_code (const char *msg, std::error_code ec)
 log a message with error-code as error. More...
 

Member Typedef Documentation

◆ server_protocol_type

Member Enumeration Documentation

◆ Stage

enum class ConnectProcessor::Stage
strong
Enumerator
InitDestination 
Resolve 
InitEndpoint 
NextEndpoint 
NextDestination 
InitConnect 
FromPool 
Connect 
ConnectFinish 
Connected 
Error 
Done 

Constructor & Destructor Documentation

◆ ConnectProcessor()

ConnectProcessor::ConnectProcessor ( MysqlRoutingClassicConnectionBase conn,
std::function< void(const classic_protocol::message::server::Error &err)>  on_error 
)
inline

Member Function Documentation

◆ connect()

stdx::expected< Processor::Result, std::error_code > ConnectProcessor::connect ( )
private

◆ connect_finish()

stdx::expected< Processor::Result, std::error_code > ConnectProcessor::connect_finish ( )
private

◆ connected()

stdx::expected< Processor::Result, std::error_code > ConnectProcessor::connected ( )
private

◆ error()

stdx::expected< Processor::Result, std::error_code > ConnectProcessor::error ( )
private

◆ from_pool()

stdx::expected< Processor::Result, std::error_code > ConnectProcessor::from_pool ( )
private

◆ init_connect()

stdx::expected< Processor::Result, std::error_code > ConnectProcessor::init_connect ( )
private

◆ init_destination()

stdx::expected< Processor::Result, std::error_code > ConnectProcessor::init_destination ( )
private

◆ init_endpoint()

stdx::expected< Processor::Result, std::error_code > ConnectProcessor::init_endpoint ( )
private

◆ is_destination_good()

bool ConnectProcessor::is_destination_good ( const std::string &  hostname,
uint16_t  port 
) const

◆ next_destination()

stdx::expected< Processor::Result, std::error_code > ConnectProcessor::next_destination ( )
private

◆ next_endpoint()

stdx::expected< Processor::Result, std::error_code > ConnectProcessor::next_endpoint ( )
private

◆ process()

stdx::expected< Processor::Result, std::error_code > ConnectProcessor::process ( )
overridevirtual

Implements BasicProcessor.

◆ resolve()

stdx::expected< Processor::Result, std::error_code > ConnectProcessor::resolve ( )
private

◆ stage() [1/2]

Stage ConnectProcessor::stage ( ) const
inline

◆ stage() [2/2]

void ConnectProcessor::stage ( Stage  stage)
inline

Member Data Documentation

◆ all_quarantined_

bool ConnectProcessor::all_quarantined_ {false}
private

◆ connect_errors_

std::vector<std::pair<std::string, std::error_code> > ConnectProcessor::connect_errors_
private

◆ connect_started_

std::chrono::steady_clock::time_point ConnectProcessor::connect_started_
private

◆ destination_ec_

std::error_code ConnectProcessor::destination_ec_
private

◆ destinations_

Destinations& ConnectProcessor::destinations_
private

◆ destinations_it_

Destinations::iterator ConnectProcessor::destinations_it_
private

◆ endpoints_

net::ip::tcp::resolver::results_type ConnectProcessor::endpoints_
private

◆ endpoints_it_

net::ip::tcp::resolver::results_type::iterator ConnectProcessor::endpoints_it_
private

◆ io_ctx_

net::io_context& ConnectProcessor::io_ctx_
private

◆ on_error_

std::function<void(const classic_protocol::message::server::Error &err)> ConnectProcessor::on_error_
private

◆ resolver_

net::ip::tcp::resolver ConnectProcessor::resolver_ {io_ctx_}
private

◆ server_endpoint_

server_protocol_type::endpoint ConnectProcessor::server_endpoint_
private

◆ stage_

Stage ConnectProcessor::stage_ {Stage::InitDestination}
private

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