Subject: Re: [Boost-users] stop thread before socket destructor
From: Igor R (boost.lists_at_[hidden])
Date: 2011-04-27 18:21:32


> Now, how could I stop the thread in the server destructor so that the handle_accept is not called anymore?

You can wait until io_service::run() exits:

>   ~stream_handler()
>   {
>      acceptor_.close();

  //...
  thread_.join();
}