
On Thu, 29 Apr 2010 10:19:59 +0200, Christopher Yeleighton
[...]May I call socket::cancel in a signal handler? How do I dispose of the open session objects?
You may only call async-signal-safe functions in a signal handler (there is a list of those functions at http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html). As the documentation of Boost.Asio doesn't mention signal handlers (as far as I know), I wouldn't assume that it's safe to call any Boost.Asio function in a signal handler (this is only safe if the implementation of a Boost.Asio function only calls async-signal-safe functions; but then an implementation can change in a new version). Maybe you can propose (or create?) a stop function which is safe to call in a signal handler (sounds like a good contribution to Boost.Asio)? Boris