|
Boost Users : |
Subject: Re: [Boost-users] AsIO daytime example needs terminate code
From: Christopher Yeleighton (giecrilj_at_[hidden])
Date: 2010-04-28 10:23:43
Christopher Yeleighton <giecrilj <at> stegny.2a.pl> writes:
>
> 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?
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net