MySQL 8.4.2
Source Code Documentation
TlsSwitchableConnection< T > Class Template Reference

a Connection that can be switched to TLS. More...

#include <connection_base.h>

Inheritance diagram for TlsSwitchableConnection< T >:
[legend]

Public Types

using protocol_state_type = T
 

Public Member Functions

 TlsSwitchableConnection (std::unique_ptr< ConnectionBase > conn, SslMode ssl_mode, protocol_state_type state)
 
 TlsSwitchableConnection (std::unique_ptr< ConnectionBase > conn, SslMode ssl_mode, Channel channel, protocol_state_type state)
 
void assign_connection (std::unique_ptr< ConnectionBase > conn)
 assign a low-level connection. More...
 
void prepare_for_pool ()
 
template<class Func >
void async_recv (Func &&func)
 async receive data from connection into the channel's receive buffer. More...
 
template<class Func >
void async_send (Func &&func)
 async send data from the channel's send buffer to the connection. More...
 
template<class Func >
void async_wait_send (Func &&func)
 async wait until connection allows to send data. More...
 
template<class Func >
void async_wait_error (Func &&func)
 
Channelchannel ()
 
const Channelchannel () const
 
SslMode ssl_mode () const
 
bool is_open () const
 
net::impl::socket::native_handle_type native_handle () const
 
stdx::expected< void, std::error_code > close () const
 
stdx::expected< void, std::error_code > shutdown (net::socket_base::shutdown_type st) const
 
std::string endpoint () const
 
stdx::expected< void, std::error_code > cancel ()
 
protocol_state_typeprotocol ()
 
const protocol_state_typeprotocol () const
 
std::unique_ptr< ConnectionBase > & connection ()
 
const std::unique_ptr< ConnectionBase > & connection () const
 
bool is_secure_transport () const
 check if the channel is secure. More...
 

Static Public Attributes

static constexpr size_t kRecvBufferSize {16UL * 1024}
 

Private Attributes

std::unique_ptr< ConnectionBaseconn_
 
SslMode ssl_mode_
 
Channel channel_
 
protocol_state_type protocol_
 

Detailed Description

template<class T>
class TlsSwitchableConnection< T >

a Connection that can be switched to TLS.

wraps

  • a low-level connections (conn)
  • a routing connection (endpoints, destinations, ...)
  • a tls switchable (a SSL_CTX * wrapper)
  • protocol state (classic, xproto)

Member Typedef Documentation

◆ protocol_state_type

template<class T >
using TlsSwitchableConnection< T >::protocol_state_type = T

Constructor & Destructor Documentation

◆ TlsSwitchableConnection() [1/2]

template<class T >
TlsSwitchableConnection< T >::TlsSwitchableConnection ( std::unique_ptr< ConnectionBase conn,
SslMode  ssl_mode,
protocol_state_type  state 
)
inline

◆ TlsSwitchableConnection() [2/2]

template<class T >
TlsSwitchableConnection< T >::TlsSwitchableConnection ( std::unique_ptr< ConnectionBase conn,
SslMode  ssl_mode,
Channel  channel,
protocol_state_type  state 
)
inline

Member Function Documentation

◆ assign_connection()

template<class T >
void TlsSwitchableConnection< T >::assign_connection ( std::unique_ptr< ConnectionBase conn)
inline

assign a low-level connection.

◆ async_recv()

template<class T >
template<class Func >
void TlsSwitchableConnection< T >::async_recv ( Func &&  func)
inline

async receive data from connection into the channel's receive buffer.

calls func when async operation is completed.

◆ async_send()

template<class T >
template<class Func >
void TlsSwitchableConnection< T >::async_send ( Func &&  func)
inline

async send data from the channel's send buffer to the connection.

calls func when async operation is completed.

◆ async_wait_error()

template<class T >
template<class Func >
void TlsSwitchableConnection< T >::async_wait_error ( Func &&  func)
inline

◆ async_wait_send()

template<class T >
template<class Func >
void TlsSwitchableConnection< T >::async_wait_send ( Func &&  func)
inline

async wait until connection allows to send data.

calls func when async operation is completed.

◆ cancel()

template<class T >
stdx::expected< void, std::error_code > TlsSwitchableConnection< T >::cancel ( )
inline

◆ channel() [1/2]

template<class T >
Channel & TlsSwitchableConnection< T >::channel ( )
inline

◆ channel() [2/2]

template<class T >
const Channel & TlsSwitchableConnection< T >::channel ( ) const
inline

◆ close()

template<class T >
stdx::expected< void, std::error_code > TlsSwitchableConnection< T >::close ( ) const
inline

◆ connection() [1/2]

template<class T >
std::unique_ptr< ConnectionBase > & TlsSwitchableConnection< T >::connection ( )
inline

◆ connection() [2/2]

template<class T >
const std::unique_ptr< ConnectionBase > & TlsSwitchableConnection< T >::connection ( ) const
inline

◆ endpoint()

template<class T >
std::string TlsSwitchableConnection< T >::endpoint ( ) const
inline

◆ is_open()

template<class T >
bool TlsSwitchableConnection< T >::is_open ( ) const
inline

◆ is_secure_transport()

template<class T >
bool TlsSwitchableConnection< T >::is_secure_transport ( ) const
inline

check if the channel is secure.

  • if TLS is enabled, it the transport is secure
  • if transport is secure, the channel is secure

◆ native_handle()

template<class T >
net::impl::socket::native_handle_type TlsSwitchableConnection< T >::native_handle ( ) const
inline

◆ prepare_for_pool()

template<class T >
void TlsSwitchableConnection< T >::prepare_for_pool ( )
inline

◆ protocol() [1/2]

template<class T >
protocol_state_type & TlsSwitchableConnection< T >::protocol ( )
inline

◆ protocol() [2/2]

template<class T >
const protocol_state_type & TlsSwitchableConnection< T >::protocol ( ) const
inline

◆ shutdown()

template<class T >
stdx::expected< void, std::error_code > TlsSwitchableConnection< T >::shutdown ( net::socket_base::shutdown_type  st) const
inline

◆ ssl_mode()

template<class T >
SslMode TlsSwitchableConnection< T >::ssl_mode ( ) const
inline

Member Data Documentation

◆ channel_

template<class T >
Channel TlsSwitchableConnection< T >::channel_
private

◆ conn_

template<class T >
std::unique_ptr<ConnectionBase> TlsSwitchableConnection< T >::conn_
private

◆ kRecvBufferSize

template<class T >
constexpr size_t TlsSwitchableConnection< T >::kRecvBufferSize {16UL * 1024}
staticconstexpr

◆ protocol_

template<class T >
protocol_state_type TlsSwitchableConnection< T >::protocol_
private

◆ ssl_mode_

template<class T >
SslMode TlsSwitchableConnection< T >::ssl_mode_
private

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