How to close connections on browser window closing ?See original GitHub issue
This is my code to run GUI, but there is issue while closing connections … How to close connection on exit ? I have set close_server_on_exit=False for not closing connection during testing a GUI.
In short, I want close connection whenever I close the browser window. How to do that ?
`from flaskwebgui import FlaskUI from main import app
FlaskUI(app, start_server=‘flask’, width=1280, height=720, close_server_on_exit=False, host=“localhost”, port=8000).run() `
- Created a year ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
When closing the GUI (pressing X) it will not close the connection right away.
Currently that’s not possible.
close_server_on_exit=True - for the web server on_exit=func()
Put the logic of what you want to close in ‘func’