Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

totally halt io_service on stop()

  • Loading branch information...
commit a70793f04484c10ddff678280298ee2d2bcf1e6b 1 parent 439a4a8
@erikfrey erikfrey authored
Showing with 2 additions and 12 deletions.
  1. +2 −12 include/darner/net/server.hpp
View
14 include/darner/net/server.hpp
@@ -47,7 +47,7 @@ class server
void stop()
{
- ios_.post(boost::bind(&server::handle_close, this));
+ ios_.stop();
// let the thread exit
runner_.join();
@@ -58,11 +58,7 @@ class server
void handle_accept(const boost::system::error_code& e)
{
if (e)
- {
- if (e != boost::asio::error::operation_aborted) // abort comes from canceling the acceptor
- log::ERROR("server::handle_accept: %1%", e.message());
- return;
- }
+ return log::ERROR("server::handle_accept: %1%", e.message());
handler_->start();
@@ -71,16 +67,10 @@ class server
boost::bind(&server::handle_accept, this, boost::asio::placeholders::error));
}
- void handle_close()
- {
- acceptor_.close();
- }
-
unsigned short listen_port_;
boost::asio::io_service ios_;
- boost::scoped_ptr<boost::asio::io_service::work> work_;
boost::asio::ip::tcp::acceptor acceptor_;
queue_map queues_;
Please sign in to comment.
Something went wrong with that request. Please try again.