MySQL 8.4.2
Source Code Documentation
BasicConnection< Protocol > Class Template Reference

basic connection which wraps a net-ts Protocol. More...

#include <connection_base.h>

Inheritance diagram for BasicConnection< Protocol >:
[legend]

Public Types

using protocol_type = Protocol
 
using socket_type = typename protocol_type::socket
 
using endpoint_type = typename protocol_type::endpoint
 
using recv_buffer_type = ConnectionBase::recv_buffer_type
 
- Public Types inherited from ConnectionBase
using recv_buffer_type = std::vector< uint8_t, default_init_allocator< uint8_t > >
 

Public Member Functions

 BasicConnection (socket_type sock, endpoint_type ep)
 
net::io_contextio_ctx () override
 
stdx::expected< void, std::error_code > set_io_context (net::io_context &new_ctx) override
 
void async_recv (recv_buffer_type &buf, std::function< void(std::error_code ec, size_t transferred)> completion) override
 
void async_send (recv_buffer_type &buf, std::function< void(std::error_code ec, size_t transferred)> completion) override
 
void async_wait_send (std::function< void(std::error_code ec)> completion) override
 
void async_wait_recv (std::function< void(std::error_code ec)> completion) override
 
void async_wait_error (std::function< void(std::error_code ec)> completion) override
 
bool is_open () const override
 
net::impl::socket::native_handle_type native_handle () const override
 
stdx::expected< void, std::error_code > close () override
 
stdx::expected< void, std::error_code > cancel () override
 
stdx::expected< void, std::error_code > shutdown (net::socket_base::shutdown_type st) override
 
std::string endpoint () const override
 
template<class GettableSocketOption >
stdx::expected< void, std::error_code > get_option (GettableSocketOption &opt) const
 
bool is_secure_transport () const override
 check if the underlying transport is secure. More...
 
- Public Member Functions inherited from ConnectionBase
virtual ~ConnectionBase ()=default
 

Protected Attributes

socket_type sock_
 
endpoint_type ep_
 

Detailed Description

template<class Protocol>
class BasicConnection< Protocol >

basic connection which wraps a net-ts Protocol.

knows about mysql-protocol specifics like:

  • session attributes
  • connection error-tracking.
Template Parameters
Protocola protocol like net::ip::tcp or local::stream_protocol

Member Typedef Documentation

◆ endpoint_type

template<class Protocol >
using BasicConnection< Protocol >::endpoint_type = typename protocol_type::endpoint

◆ protocol_type

template<class Protocol >
using BasicConnection< Protocol >::protocol_type = Protocol

◆ recv_buffer_type

◆ socket_type

template<class Protocol >
using BasicConnection< Protocol >::socket_type = typename protocol_type::socket

Constructor & Destructor Documentation

◆ BasicConnection()

template<class Protocol >
BasicConnection< Protocol >::BasicConnection ( socket_type  sock,
endpoint_type  ep 
)
inline

Member Function Documentation

◆ async_recv()

template<class Protocol >
void BasicConnection< Protocol >::async_recv ( recv_buffer_type buf,
std::function< void(std::error_code ec, size_t transferred)>  completion 
)
inlineoverridevirtual

Implements ConnectionBase.

◆ async_send()

template<class Protocol >
void BasicConnection< Protocol >::async_send ( recv_buffer_type buf,
std::function< void(std::error_code ec, size_t transferred)>  completion 
)
inlineoverridevirtual

Implements ConnectionBase.

◆ async_wait_error()

template<class Protocol >
void BasicConnection< Protocol >::async_wait_error ( std::function< void(std::error_code ec)>  completion)
inlineoverridevirtual

Implements ConnectionBase.

◆ async_wait_recv()

template<class Protocol >
void BasicConnection< Protocol >::async_wait_recv ( std::function< void(std::error_code ec)>  completion)
inlineoverridevirtual

Implements ConnectionBase.

◆ async_wait_send()

template<class Protocol >
void BasicConnection< Protocol >::async_wait_send ( std::function< void(std::error_code ec)>  completion)
inlineoverridevirtual

Implements ConnectionBase.

◆ cancel()

template<class Protocol >
stdx::expected< void, std::error_code > BasicConnection< Protocol >::cancel ( )
inlineoverridevirtual

Implements ConnectionBase.

◆ close()

template<class Protocol >
stdx::expected< void, std::error_code > BasicConnection< Protocol >::close ( )
inlineoverridevirtual

Implements ConnectionBase.

◆ endpoint()

template<class Protocol >
std::string BasicConnection< Protocol >::endpoint ( ) const
inlineoverridevirtual

Implements ConnectionBase.

◆ get_option()

template<class Protocol >
template<class GettableSocketOption >
stdx::expected< void, std::error_code > BasicConnection< Protocol >::get_option ( GettableSocketOption &  opt) const
inline

◆ io_ctx()

template<class Protocol >
net::io_context & BasicConnection< Protocol >::io_ctx ( )
inlineoverridevirtual

Implements ConnectionBase.

◆ is_open()

template<class Protocol >
bool BasicConnection< Protocol >::is_open ( ) const
inlineoverridevirtual

Implements ConnectionBase.

◆ is_secure_transport()

template<class Protocol >
bool BasicConnection< Protocol >::is_secure_transport ( ) const
inlineoverridevirtual

check if the underlying transport is secure.

  • unix-socket, shared-memory, ... are secure.

Implements ConnectionBase.

◆ native_handle()

template<class Protocol >
net::impl::socket::native_handle_type BasicConnection< Protocol >::native_handle ( ) const
inlineoverridevirtual

Implements ConnectionBase.

◆ set_io_context()

template<class Protocol >
stdx::expected< void, std::error_code > BasicConnection< Protocol >::set_io_context ( net::io_context new_ctx)
inlineoverridevirtual

Implements ConnectionBase.

◆ shutdown()

template<class Protocol >
stdx::expected< void, std::error_code > BasicConnection< Protocol >::shutdown ( net::socket_base::shutdown_type  st)
inlineoverridevirtual

Implements ConnectionBase.

Member Data Documentation

◆ ep_

template<class Protocol >
endpoint_type BasicConnection< Protocol >::ep_
protected

◆ sock_

template<class Protocol >
socket_type BasicConnection< Protocol >::sock_
protected

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