From 6cdae64ba9ce3a9f02f3a7437cfff078d942cba1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 14 Jun 2024 01:38:37 +0200 Subject: Do everything required to stop the server in ::stop(). --- src/lib/server.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/server.cc b/src/lib/server.cc index c1be5735e..6e3781dca 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -41,13 +41,7 @@ Server::Server (int port, int timeout) Server::~Server () { - { - boost::mutex::scoped_lock lm (_mutex); - _terminate = true; - } - - _acceptor.close (); - stop (); + stop(); } @@ -89,5 +83,11 @@ Server::handle_accept (shared_ptr socket, boost::system::error_code cons void Server::stop () { + { + boost::mutex::scoped_lock lm (_mutex); + _terminate = true; + } + + _acceptor.close (); _io_service.stop (); } -- cgit v1.2.3