
28 Apr
2010
28 Apr
'10
2:23 p.m.
Christopher Yeleighton
Regarding Daytime.3 - An asynchronous TCP daytime server: [1]
There is no way to stop this server! I can kill it under Linux but then it aborts instead of exiting, which is in general not good.
== My solution == Add a global quit event variable. Handle the QUIT signal by setting the quit event. Test for the quit event within the event loop.
Of course this works for the synchronous server where there is an explicit loop; an asynchronous server needs to call { service->stop(); } My experiment shows that it is does not produce any visible failure under SuSE; however, it is not clear whether io_service::stop can be called from within a signal handler. Help?