I have a Flask-SocketIO server, which initialize a GUI in a separated thread.
if __name__ == '__main__':
if len(sys.argv) > 1 and sys.argv[1] == 'dev':
print "Running Flask-SocketIO on dev mode"
else:
print "Running Flask-SocketIO on production mode"
print 'Running Graphical User Interface...'
thread.start_new_thread(display_react.main, ())
print 'Initializing server'
socketio.run(app, debug=False)
The GUI is basically the cefpthon3 example which use the wxPython, but instead of being a normal browser, it only shows up a specific page served by the server. At the moment i want the whole app shutdown when i close the GUI. For the effect, i've created a route on the server which (when called) will shutdown the server.
@app.route('/shutdown', methods=['GET'])
def shutdown():
server_request.shutdown()
socketio.stop()
print "Trying to close..."
return 'Server shutting down...'
And this route is called when before close the wxPython.
However, this error appears before the server shutdown:
Can anyone help me solving or hiding this?