Boost Asio总结(13) 信号
1.1
eg.
typedef basic_signal_set signal_set;
void handler(
const boost::system::error_code& error,
int signal_number)
{
if (!error)
{
// A signal occurred.
}
}
...
// Construct a signal set registered for process termination.
boost::asio::signal_set signals(my_context, SIGINT, SIGTERM);
// Start an asynchronous wait for one of the signals to occur.
signals.async_wait(handler);
1.2
t
共有 0 条评论