
Hi, I was wondering if we could use setitimer() in a code base that utilizes ASIO deadline_timer? I have a server code which uses ASIO for various async operations --including a few async timers. It uses io_service.run() in the main function to dispatch events. The server needs to gracefully shutdown, meaning that it should finish all the currently queue events. As an upper bound to the graceful shutdown, I want to set a timer to guarantee the code will exit. Adding the timer, howerver, as an ASIO deadline_timer will force the run() function to wait until the shutdown timer expires. Using setitimer() and handling SIGALRM looks like a better alternative for me. I think it works, but I need to know whether there is no side effect to this. Thanks, Nader PS. NO, I cannot use io_service.run_one() :)