python - stopping a cherrypy server over http -


I have a cherry app that I am controlling with http with a wxpython UI. I want to kill the server when UI stops, but I do not know how to do it. Right now I'm just doing a sys.exit () on the window closure event, but the result is in

  traceback (most recent call last): file "ui.py" Line 67, Exitevent urllib.urlopen (in "http: //" + server + "/? Sigkill = 1") in the file "c: \ python26 \ lib \ urllib.py", line 87, urlopen return opener. The file "c: \ python26 \ lib \ urllib.py", in the "C: \ python26 \ lib \ urllib.py", line 206, open return getattr (auto, name) in the file, line 354 Found a bad in 'open_http' ('HTTP protocol error', 0, 'bad status line' received, none)  

This is because I do not stop the custodian properly Am I

How are you stopping CherryPy? By sending Sigil yourself? You should send at least TERM instead, but it would be better to call cherrypy.engine.exit () (version 3.1+). Both techniques have allowed Cheripee to stop sluggishly, which includes the permission to terminate any in-process requests (such as "sigkill = 1" themselves request) and to clean it off.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -