30 using boost::system::error_code;
32 auto session = std::make_shared<ServerSession>(
_io_context, timeout, *
this);
34 auto handle_query = [on_opened, on_closed, session](
const error_code &ec) {
36 session->Open(std::move(on_opened), std::move(on_closed));
38 log_error(
"tcp accept stream error:", ec.message());
42 _acceptor.async_accept(session->_socket, [=](error_code ec) {
44 boost::asio::post(_io_context, [=]() { handle_query(ec); });