RESTinio
Public Types | Public Member Functions | Private Attributes | List of all members
restinio::impl::tls_socket_t Class Reference

Socket adapter for asio::ssl::stream< asio::ip::tcp::socket >. More...

#include <tls_socket.hpp>

Public Types

using socket_t = asio_ns::ssl::stream< asio_ns::ip::tcp::socket >
 
using context_handle_t = std::shared_ptr< asio_ns::ssl::context >
 

Public Member Functions

 tls_socket_t (const tls_socket_t &)=delete
 
tls_socket_toperator= (const tls_socket_t &)=delete
 
 tls_socket_t (asio_ns::io_context &io_context, context_handle_t tls_context)
 
 tls_socket_t (tls_socket_t &&)=default
 
tls_socket_toperator= (tls_socket_t &&)=default
 
void swap (tls_socket_t &sock)
 
auto & lowest_layer ()
 
const auto & lowest_layer () const
 
auto get_executor ()
 
auto remote_endpoint () const
 
auto is_open () const
 
template<typename... Args>
void cancel (Args &&... args)
 
template<typename... Args>
auto async_read_some (Args &&... args)
 
template<typename... Args>
auto async_write_some (Args &&... args)
 
template<typename... Args>
void shutdown (Args &&... args)
 
template<typename... Args>
void close (Args &&... args)
 
template<typename... Args>
auto async_handshake (Args &&... args)
 
auto & get_io_context ()
 

Private Attributes

context_handle_t m_context
 
std::unique_ptr< socket_tm_socket
 

Detailed Description

Socket adapter for asio::ssl::stream< asio::ip::tcp::socket >.

As asio::ssl::stream< asio::ip::tcp::socket > class is not movable and lack some some functionality compared to asio::ip::tcp::socket it is necesasary to have an adapter for it to use it the same way as asio::ip::tcp::socket in template classes and functions.

Definition at line 34 of file tls_socket.hpp.

Member Typedef Documentation

◆ context_handle_t

using restinio::impl::tls_socket_t::context_handle_t = std::shared_ptr< asio_ns::ssl::context >

Definition at line 38 of file tls_socket.hpp.

◆ socket_t

using restinio::impl::tls_socket_t::socket_t = asio_ns::ssl::stream< asio_ns::ip::tcp::socket >

Definition at line 37 of file tls_socket.hpp.

Constructor & Destructor Documentation

◆ tls_socket_t() [1/3]

restinio::impl::tls_socket_t::tls_socket_t ( const tls_socket_t )
delete

◆ tls_socket_t() [2/3]

restinio::impl::tls_socket_t::tls_socket_t ( asio_ns::io_context &  io_context,
context_handle_t  tls_context 
)
inline

Definition at line 42 of file tls_socket.hpp.

◆ tls_socket_t() [3/3]

restinio::impl::tls_socket_t::tls_socket_t ( tls_socket_t &&  )
default

Member Function Documentation

◆ async_handshake()

template<typename... Args>
auto restinio::impl::tls_socket_t::async_handshake ( Args &&...  args)
inline

Definition at line 126 of file tls_socket.hpp.

◆ async_read_some()

template<typename... Args>
auto restinio::impl::tls_socket_t::async_read_some ( Args &&...  args)
inline

Definition at line 98 of file tls_socket.hpp.

◆ async_write_some()

template<typename... Args>
auto restinio::impl::tls_socket_t::async_write_some ( Args &&...  args)
inline

Definition at line 105 of file tls_socket.hpp.

◆ cancel()

template<typename... Args>
void restinio::impl::tls_socket_t::cancel ( Args &&...  args)
inline

Definition at line 91 of file tls_socket.hpp.

◆ close()

template<typename... Args>
void restinio::impl::tls_socket_t::close ( Args &&...  args)
inline

Definition at line 119 of file tls_socket.hpp.

◆ get_executor()

auto restinio::impl::tls_socket_t::get_executor ( )
inline

Definition at line 72 of file tls_socket.hpp.

◆ get_io_context()

auto& restinio::impl::tls_socket_t::get_io_context ( )
inline

Definition at line 132 of file tls_socket.hpp.

◆ is_open()

auto restinio::impl::tls_socket_t::is_open ( ) const
inline

Definition at line 84 of file tls_socket.hpp.

◆ lowest_layer() [1/2]

auto& restinio::impl::tls_socket_t::lowest_layer ( )
inline

Definition at line 60 of file tls_socket.hpp.

◆ lowest_layer() [2/2]

const auto& restinio::impl::tls_socket_t::lowest_layer ( ) const
inline

Definition at line 66 of file tls_socket.hpp.

◆ operator=() [1/2]

tls_socket_t& restinio::impl::tls_socket_t::operator= ( const tls_socket_t )
delete

◆ operator=() [2/2]

tls_socket_t& restinio::impl::tls_socket_t::operator= ( tls_socket_t &&  )
default

◆ remote_endpoint()

auto restinio::impl::tls_socket_t::remote_endpoint ( ) const
inline

Definition at line 78 of file tls_socket.hpp.

◆ shutdown()

template<typename... Args>
void restinio::impl::tls_socket_t::shutdown ( Args &&...  args)
inline

Definition at line 112 of file tls_socket.hpp.

◆ swap()

void restinio::impl::tls_socket_t::swap ( tls_socket_t sock)
inline

Definition at line 53 of file tls_socket.hpp.

Member Data Documentation

◆ m_context

context_handle_t restinio::impl::tls_socket_t::m_context
private

Definition at line 138 of file tls_socket.hpp.

◆ m_socket

std::unique_ptr< socket_t > restinio::impl::tls_socket_t::m_socket
private

Definition at line 139 of file tls_socket.hpp.


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