43 using boost::system::error_code;
45 auto session = std::make_shared<Primary>(
_io_context, timeout, *
this);
46 auto self = shared_from_this();
48 auto handle_query = [on_opened, on_closed, on_response, session, self](
const error_code &ec) {
50 session->Open(std::move(on_opened), std::move(on_closed), std::move(on_response));
52 log_error(
"Secondary server:", ec.message());
56 _acceptor.async_accept(session->_socket, [=](error_code ec) {
58 boost::asio::post(_io_context, [=]() { handle_query(ec); });
59 OpenSession(timeout, on_opened, on_closed, on_response);