&nbsp; During last weekend i was work on bug about stopping oval-server on keyboard interrupt from console (aka CTRL+C bug).<br><br>&nbsp; I was implement and commit proper handling of CTRL+C (which translated in KeyboardException inside  Python) in main thread of oval-server. But python don&#39;t have api to stop execution of child thread, therefore i implement child threads with:
<br><br>while self.__status:<br>&nbsp; &lt;handle&gt;<br>&nbsp; &lt;sleep&gt;<br><br>&nbsp; In case of syncThread i&#39;m use sleep with timeout, but in httpThread used call to socket.accept () and thread is blocked on this call until receive request from client. And i can&#39;t stop httpThread in clear way.
<br><br>&nbsp; Reading google and some experiments give me three version of stopping http thread:<br>1. mainThread on KeyboardException send yourself HUP or KILL signal and this signal kills all thread.<br>2. Use sockets timeouts. With timeouts accept call was interrupted after some time. But in this case i must rewrite some methods of parent HttpServer class.
<br>3. Emulate client connection to httpThread from mainThread.<br><br>&nbsp; I think that second choice is a best way, but first simplest. Any suggest or any approach?<br clear="all">
<br>-- <br>Pavel Vinogradov<br>NixDev.Net, Linux Developer