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_t & | operator= (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_t & | operator= (tls_socket_t &&)=default
void | swap (tls_socket_t &sock)
auto & | lowest_layer ()
const auto & | lowest_layer () const
socket_t & | asio_ssl_stream ()
| Get an access to underlying Asio's socket. More...
const socket_t & | asio_ssl_stream () const
| Get an access to underlying Asio's socket. More...
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)

## Private Attributes
context_handle_t | m_context
std::unique_ptr< socket_t > | m_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 36 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 40 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 39 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 48 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

## ◆ asio_ssl_stream() [1/2]

socket_t & restinio::impl::tls_socket_t::asio_ssl_stream | ( |  | ) |
| inline

Get an access to underlying Asio's socket.

This feature can be useful if there is a need to call some Asio's socket specific methods like `native_handle`.

Since
  v.0.5.2

Definition at line 87 of file tls_socket.hpp.

## ◆ asio_ssl_stream() [2/2]

const socket_t & restinio::impl::tls_socket_t::asio_ssl_stream | ( |  | ) | const
| inline

Get an access to underlying Asio's socket.

This feature can be useful if there is a need to call some Asio's socket specific methods like `native_handle`.

Since
  v.0.5.2

Definition at line 102 of file tls_socket.hpp.

## ◆ async_handshake()

template<typename... Args>

auto restinio::impl::tls_socket_t::async_handshake | ( | Args &&... | args | ) |
| inline

Definition at line 162 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 134 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 141 of file tls_socket.hpp.

## ◆ cancel()

template<typename... Args>

void restinio::impl::tls_socket_t::cancel | ( | Args &&... | args | ) |
| inline

Definition at line 127 of file tls_socket.hpp.

## ◆ close()

template<typename... Args>

void restinio::impl::tls_socket_t::close | ( | Args &&... | args | ) |
| inline

Definition at line 155 of file tls_socket.hpp.

## ◆ get_executor()

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

Definition at line 108 of file tls_socket.hpp.

## ◆ is_open()

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

Definition at line 120 of file tls_socket.hpp.

## ◆ lowest_layer() [1/2]

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

Definition at line 66 of file tls_socket.hpp.

## ◆ lowest_layer() [2/2]

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

Definition at line 72 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 114 of file tls_socket.hpp.

## ◆ shutdown()

template<typename... Args>

void restinio::impl::tls_socket_t::shutdown | ( | Args &&... | args | ) |
| inline

Definition at line 148 of file tls_socket.hpp.

## ◆ swap()

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

Definition at line 59 of file tls_socket.hpp.

## Member Data Documentation

## ◆ m_context

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

Definition at line 168 of file tls_socket.hpp.

## ◆ m_socket

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

Definition at line 169 of file tls_socket.hpp.

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

- restinio/impl/tls_socket.hpp