asio: Remove signal handling from server

This commit is contained in:
Tatsuhiro Tsujikawa 2015-03-07 00:00:39 +09:00
parent b24bd3d8cb
commit c3265de625
2 changed files with 1 additions and 17 deletions

View File

@ -47,20 +47,8 @@ namespace server {
server::server(std::size_t io_service_pool_size)
: io_service_pool_(io_service_pool_size),
signals_(io_service_pool_.get_io_service()),
tick_timer_(io_service_pool_.get_io_service(),
boost::posix_time::seconds(1)) {
// Register to handle the signals that indicate when the server should exit.
// It is safe to register for the same signal multiple times in a program,
// provided all registration for the specified signal is made through Asio.
signals_.add(SIGINT);
signals_.add(SIGTERM);
#if defined(SIGQUIT)
signals_.add(SIGQUIT);
#endif // defined(SIGQUIT)
signals_.async_wait([this](const boost::system::error_code &error,
int signal_number) { io_service_pool_.stop(); });
}
boost::posix_time::seconds(1)) {}
boost::system::error_code
server::listen_and_serve(boost::system::error_code &ec,

View File

@ -90,10 +90,6 @@ private:
/// operations.
io_service_pool io_service_pool_;
/// The signal_set is used to register for process termination
/// notifications.
boost::asio::signal_set signals_;
boost::asio::deadline_timer tick_timer_;
/// Acceptor used to listen for incoming connections.