Merge d9ddb73a74
into 5195e8be6a
This commit is contained in:
commit
6c9ed2c0f7
|
@ -188,7 +188,13 @@ void server::start_accept(tcp::acceptor &acceptor, serve_mux &mux) {
|
||||||
|
|
||||||
void server::stop() {
|
void server::stop() {
|
||||||
for (auto &acceptor : acceptors_) {
|
for (auto &acceptor : acceptors_) {
|
||||||
acceptor.close();
|
std::promise<void> promise;
|
||||||
|
GET_IO_SERVICE ( acceptor ).dispatch ( [&acceptor, &promise]() {
|
||||||
|
boost::system::error_code ignored_ec;
|
||||||
|
acceptor.close ( ignored_ec );
|
||||||
|
promise.set_value();
|
||||||
|
} );
|
||||||
|
promise.get_future().get();
|
||||||
}
|
}
|
||||||
io_service_pool_.stop();
|
io_service_pool_.stop();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue