Server::~Server ()
{
- boost::mutex::scoped_lock lm (_mutex);
- _terminate = true;
- _io_service.stop ();
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _terminate = true;
+ }
+
+ _acceptor.close ();
+ stop ();
}
void
handle (socket);
start_accept ();
}
+
+void
+Server::stop ()
+{
+ _io_service.stop ();
+}