"Aahz" <a...@pythoncraft.com> wrote in message news:hl2ob2$3i...@panix5.panix.com...
In article <mailman.2077.1265524158.28905.python-l...@python.org>,
Gabriel Genellina <gagsl-...@yahoo.com.ar> wrote:

Strange. With Python 2.6.4 I don't need to do that; I'd say the difference
is in the OS or antivirus (some AV are known to break the TCP stack).

Perhaps, but I've also found that ctrl-C doesn't work on Windows.

I don't know if this is exactly the same, but FWIW ...

I had the following, in a test program -

   from wsgiref.simple_server import make_server

   myserver = MyServer()
   httpd = make_server('', 7789, myserver)
   httpd.serve_forever()

   try:
       while True:
           sleep(1)
   except KeyboardInterrupt:
       httpd.shutdown()

I could not get it to respond to Ctrl-C.

Then I read somewhere that it must run in a separate thread, so I changed it like this -

-   httpd.serve_forever()
+   threading.Thread(target=httpd.serve_forever).start()

Now it does respond to Ctrl-C.

HTH

Frank Millman


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to