Boost logo

Boost Users :

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();
}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net