[Boost-bugs] [Boost C++ Libraries] #2879: [asio] Handling of unix signals

Subject: [Boost-bugs] [Boost C++ Libraries] #2879: [asio] Handling of unix signals
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-03-20 17:35:01


#2879: [asio] Handling of unix signals
-----------------------------------+----------------------------------------
 Reporter: dgoncharov_at_[hidden] | Owner: chris_kohlhoff
     Type: Feature Requests | Status: new
Milestone: Boost 1.39.0 | Component: asio
  Version: Boost 1.38.0 | Severity: Problem
 Keywords: |
-----------------------------------+----------------------------------------
 This proposal suggests adding to asio the ability to invoke a handler
 whenever a unix signal arrives.

 Motivation:

 1. The extension lets the user have a unix signal handler of an arbitrary
 signature.

 2. The extension also removes the "async-signal safe calls" restriction
 from a handler of a unix signal.

 The extension is supposed to be used like this:

 void on_signal(boost::system::error_code const& error)
 {
     if (!error)
         cout << "sigint received" << endl;
 }

 int main(int argc, char const* argv[])

 {
     boost::asio::io_service ios;
     boost::asio::posix::signal_handler<SIGINT> sigint(ios);
     while (true)
     {
         ios.reset();
         sigint.async_wait(boost::bind(on_signal, _1));
         ios.poll();
     }
 }

 The original proposal on the mail list can be found here.
 http://lists.boost.org/Archives/boost/2009/03/149890.php


 Please find the implementation and examples in the attachments.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2879>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC