My program needs to gracefully terminate when a Windows event becomes signaled. I am using Boost’s ASIO library for it’s sockets. I only have one io_service object. How can I ‘register’ this event handle with the io_service, so it calls a callback when the event signals?
My program needs to gracefully terminate when a Windows event becomes signaled. I am
Share
If you’re looking for termination handling on Windows for Boost.Asio you can take a look at the examples here.
In short, you need to handle the win events and call stop on your system.
This uses a function object:
that you need to bind to your system’s shutdown/stop routine.