SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::Comm::ConnHandlerSSL Class Referencefinal

#include <swcdb/core/comm/ConnHandler.h>

+ Inheritance diagram for SWC::Comm::ConnHandlerSSL:
+ Collaboration diagram for SWC::Comm::ConnHandlerSSL:

Public Types

typedef std::shared_ptr< ConnHandlerSSLPtr
 

Public Member Functions

virtual ~ConnHandlerSSL () noexcept
 
bool is_secure () const noexcept override
 
void do_close () noexcept override
 
bool is_open () const noexcept override
 
template<typename T >
void set_verify (T &&hdlr) noexcept
 
template<typename T >
void handshake (SocketSSL::handshake_type typ, T &&hdlr) noexcept
 
void handshake (SocketSSL::handshake_type typ, asio::error_code &ec) noexcept
 
- Public Member Functions inherited from SWC::Comm::ConnHandler
 ConnHandler (const ConnHandler &)=delete
 
 ConnHandler (ConnHandler &&)=delete
 
ConnHandleroperator= (const ConnHandler &)=delete
 
ConnHandleroperator= (ConnHandler &&)=delete
 
SWC_CAN_INLINE size_t endpoint_remote_hash () const noexcept
 
SWC_CAN_INLINE size_t endpoint_local_hash () const noexcept
 
SWC_CAN_INLINE Core::Encoder::Type get_encoder () const noexcept
 
void new_connection ()
 
size_t pending_read () noexcept
 
SWC_CAN_INLINE bool due ()
 
bool send_error (int error, const std::string &msg, const Event::Ptr &ev) noexcept
 
bool response_ok (const Event::Ptr &ev) noexcept
 
bool send_response (Buffers::Ptr cbuf, DispatchHandler::Ptr hdlr=nullptr) noexcept
 
bool send_request (Buffers::Ptr cbuf, DispatchHandler::Ptr hdlr)
 
void print (std::ostream &out) const
 

Static Public Member Functions

static Ptr make (AppContext::Ptr &app_ctx, asio::ssl::context &ssl_ctx, SocketPlain &socket)
 

Protected Member Functions

SocketLayer *SWC_CONST_FUNC socket_layer () noexcept override
 
void read (uint8_t **bufp, size_t *remainp, asio::error_code &ec) override
 
void do_async_write (Core::Vector< asio::const_buffer > &&buffers, Sender_noAck &&hdlr) noexcept override
 
void do_async_write (Core::Vector< asio::const_buffer > &&buffers, Sender_Ack &&hdlr) noexcept override
 
void do_async_read (uint8_t *data, uint32_t sz, Receiver_HeaderPrefix &&hdlr) noexcept override
 
void do_async_read (uint8_t *data, uint32_t sz, Receiver_Header &&hdlr) noexcept override
 
void do_async_read (uint8_t *data, uint32_t sz, Receiver_Buffer &&hdlr) noexcept override
 
- Protected Member Functions inherited from SWC::Comm::ConnHandler
SWC_CAN_INLINE ConnHandler (AppContext::Ptr &a_app_ctx) noexcept
 
SWC_CAN_INLINE ConnHandlerPtr ptr () noexcept
 
virtual ~ConnHandler () noexcept
 
void do_close_run () noexcept
 
void disconnected () noexcept
 

Private Member Functions

 ConnHandlerSSL (AppContext::Ptr &app_ctx, asio::ssl::context &ssl_ctx, SocketPlain &socket) noexcept
 

Private Attributes

SocketSSL m_sock
 
asio::strand< SocketSSL::executor_type > m_strand
 

Additional Inherited Members

- Public Attributes inherited from SWC::Comm::ConnHandler
Core::AtomicBool connected
 
const AppContext::Ptr app_ctx
 
EndPoint endpoint_remote
 
EndPoint endpoint_local
 
- Protected Attributes inherited from SWC::Comm::ConnHandler
Core::MutexSptd m_mutex
 

Detailed Description

Definition at line 296 of file ConnHandler.h.

Member Typedef Documentation

◆ Ptr

Definition at line 299 of file ConnHandler.h.

Constructor & Destructor Documentation

◆ ~ConnHandlerSSL()

SWC::Comm::ConnHandlerSSL::~ConnHandlerSSL ( )
virtualnoexcept

Definition at line 674 of file ConnHandler.cc.

References is_open(), and m_sock.

+ Here is the call graph for this function:

◆ ConnHandlerSSL()

SWC::Comm::ConnHandlerSSL::ConnHandlerSSL ( AppContext::Ptr app_ctx,
asio::ssl::context &  ssl_ctx,
SocketPlain socket 
)
privatenoexcept

Definition at line 665 of file ConnHandler.cc.

Referenced by make().

+ Here is the caller graph for this function:

Member Function Documentation

◆ do_async_read() [1/3]

void SWC::Comm::ConnHandlerSSL::do_async_read ( uint8_t *  data,
uint32_t  sz,
ConnHandler::Receiver_Buffer &&  hdlr 
)
overrideprotectedvirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 769 of file ConnHandler.cc.

References data.

◆ do_async_read() [2/3]

void SWC::Comm::ConnHandlerSSL::do_async_read ( uint8_t *  data,
uint32_t  sz,
ConnHandler::Receiver_Header &&  hdlr 
)
overrideprotectedvirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 760 of file ConnHandler.cc.

References data.

◆ do_async_read() [3/3]

void SWC::Comm::ConnHandlerSSL::do_async_read ( uint8_t *  data,
uint32_t  sz,
ConnHandler::Receiver_HeaderPrefix &&  hdlr 
)
overrideprotectedvirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 751 of file ConnHandler.cc.

References data.

◆ do_async_write() [1/2]

void SWC::Comm::ConnHandlerSSL::do_async_write ( Core::Vector< asio::const_buffer > &&  buffers,
ConnHandler::Sender_Ack &&  hdlr 
)
overrideprotectedvirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 741 of file ConnHandler.cc.

References buffers.

◆ do_async_write() [2/2]

void SWC::Comm::ConnHandlerSSL::do_async_write ( Core::Vector< asio::const_buffer > &&  buffers,
ConnHandler::Sender_noAck &&  hdlr 
)
overrideprotectedvirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 731 of file ConnHandler.cc.

References buffers.

◆ do_close()

void SWC::Comm::ConnHandlerSSL::do_close ( )
overridevirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 681 of file ConnHandler.cc.

References SWC::Core::AtomicBase< T, OrderT >::compare_exchange_weak(), SWC::Comm::ConnHandler::connected, SWC::Comm::ConnHandler::disconnected(), SWC::Comm::ConnHandler::do_close_run(), and m_sock.

+ Here is the call graph for this function:

◆ handshake() [1/2]

void SWC::Comm::ConnHandlerSSL::handshake ( SocketSSL::handshake_type  typ,
asio::error_code &  ec 
)
noexcept

Definition at line 712 of file ConnHandler.cc.

◆ handshake() [2/2]

template<typename T >
void SWC::Comm::ConnHandlerSSL::handshake ( SocketSSL::handshake_type  typ,
T &&  hdlr 
)
inlinenoexcept

Definition at line 318 of file ConnHandler.h.

References SWC::Comm::ConnHandlerPlain::m_sock.

◆ is_open()

bool SWC::Comm::ConnHandlerSSL::is_open ( ) const
overridevirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 708 of file ConnHandler.cc.

References SWC::Comm::ConnHandler::connected, and m_sock.

Referenced by ~ConnHandlerSSL().

+ Here is the caller graph for this function:

◆ is_secure()

bool SWC::Comm::ConnHandlerSSL::is_secure ( ) const
inlineoverridevirtualnoexcept

Reimplemented from SWC::Comm::ConnHandler.

Definition at line 306 of file ConnHandler.h.

◆ make()

ConnHandlerSSL::Ptr SWC::Comm::ConnHandlerSSL::make ( AppContext::Ptr app_ctx,
asio::ssl::context &  ssl_ctx,
SocketPlain socket 
)
static

Definition at line 660 of file ConnHandler.cc.

References SWC::Comm::ConnHandler::app_ctx, and ConnHandlerSSL().

Referenced by SWC::Comm::ConfigSSL::make_connection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

void SWC::Comm::ConnHandlerSSL::read ( uint8_t **  bufp,
size_t *  remainp,
asio::error_code &  ec 
)
overrideprotectedvirtual

Implements SWC::Comm::ConnHandler.

Definition at line 779 of file ConnHandler.cc.

References m_sock, and SWC::Comm::ConnHandler::read().

+ Here is the call graph for this function:

◆ set_verify()

template<typename T >
void SWC::Comm::ConnHandlerSSL::set_verify ( T &&  hdlr)
inlinenoexcept

Definition at line 313 of file ConnHandler.h.

References SWC::Comm::ConnHandlerPlain::m_sock.

◆ socket_layer()

SocketLayer * SWC::Comm::ConnHandlerSSL::socket_layer ( )
overrideprotectedvirtualnoexcept

Implements SWC::Comm::ConnHandler.

Definition at line 723 of file ConnHandler.cc.

References m_sock.

Member Data Documentation

◆ m_sock

SocketSSL SWC::Comm::ConnHandlerSSL::m_sock
private

Definition at line 357 of file ConnHandler.h.

Referenced by do_close(), is_open(), read(), socket_layer(), and ~ConnHandlerSSL().

◆ m_strand

asio::strand<SocketSSL::executor_type> SWC::Comm::ConnHandlerSSL::m_strand
private

Definition at line 358 of file ConnHandler.h.


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