
28 Apr
2010
28 Apr
'10
11 p.m.
On Wed, 28 Apr 2010 23:47:13 +0200, Christopher Yeleighton
[...]So how do I handle signals without breaking something?
You could for example create a pipe and write to it in the signal handler (write is a function you can call in a signal handler). Somewhere else in your program you read from the pipe (as you use Boost.Asio anyway eg. with boost::asio::posix::stream_descriptor). If read returns you know it's time to shutdown the server. And as you are not in a signal handler anymore you can call io_service::stop. Boris