Boost C++ Libraries

PrevUpHomeNext

Function template tls

boost::taar::server::tls — Coroutine that accepts TLS connections, making connection strands from the executor it is spawned on.

Synopsis

// In header: <boost/taar/server/tls.hpp>


template<typename SessionHandler> 
  awaitable< void > 
  tls(std::string bind_host, std::string bind_port, 
      boost::asio::ssl::context & tls, SessionHandler && session_handler, 
      cancellation_signals & signals, 
      std::function< void(boost::asio::ip::tcp::endpoint const &)> local_endpoint_handler = nullptr, 
      std::chrono::steady_clock::duration handshake_timeout = std::chrono::seconds {30});

Description

Equivalent to the overload taking a connection_executor, with co_await this_coro::executor in its place. Spawn it on the io_context (or thread pool) executor itself; spawned on a strand, every connection would be serialised through that strand, so use the overload taking an explicit connection_executor instead.

Throws:

boost::taar::exception carrying the system error code if name resolution, binding or listening fails.

PrevUpHomeNext