How to close connections on browser window closing ?
See original GitHub issueThis 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() `
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Closing web browser windows doesn't close connections
Closing the private window closed the connections associated with the window, in every browser. Thus, it seems pretty clear that this behavior ...
Read more >Closing web browser windows doesn't close connections
On the Mac: Closing a window just closes a window. Quitting the application closes all connections sure and true. Connections can be shared ......
Read more >Closing Web Browser Windows Doesn't Close Connections
Closing the private window closed the connections associated with the window, in every browser. Thus, it seems pretty clear that this ...
Read more >Closing a Server connection session through a web browser
In the user menu, select Log out. The web browser window shows the page for entering account credentials. Article ID: 151471, Last review:...
Read more >how to close a websocket like if chrome window was ...
Finally, type socket.close(); in the browser's console and run netstat -an -p tcpv6 again, you'll notice that the previous row has disappeared.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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’