| 52 | } |
| 53 | |
| 54 | void server::do_accept() |
| 55 | { |
| 56 | acceptor_.async_accept(io_context_pool_.get_io_context(), |
| 57 | [this](boost::system::error_code ec, boost::asio::ip::tcp::socket socket) |
| 58 | { |
| 59 | // Check whether the server was stopped by a signal before this |
| 60 | // completion handler had a chance to run. |
| 61 | if (!acceptor_.is_open()) |
| 62 | { |
| 63 | return; |
| 64 | } |
| 65 | |
| 66 | if (!ec) |
| 67 | { |
| 68 | std::make_shared<connection>( |
| 69 | std::move(socket), request_handler_)->start(); |
| 70 | } |
| 71 | |
| 72 | do_accept(); |
| 73 | }); |
| 74 | } |
| 75 | |
| 76 | void server::do_await_stop() |
| 77 | { |
nothing calls this directly
no test coverage detected