python-eel / Eel

A little Python library for making simple Electron-like HTML/JS GUI apps
MIT License
6.44k stars 587 forks source link

Handle reconnect to websocket if connection lost? #317

Closed thelinuxdude closed 4 years ago

thelinuxdude commented 4 years ago

Is your feature request related to a problem? Please describe. When a connection between the client websocket and the server are lost, say due to the networking going down. From the UI side, I could not tell it was down until I made a call to an eel functions that was being exposed. This fails with an "WebSocket is already in CLOSING or CLOSED state"

Describe the solution you'd like I would like away to re-connect on a failure or indicate back to the UI that there was a failure. I rather have it reconnect first before reporting any problems.

Describe alternatives you've considered Not sure the best place to change in the eel.js to catch the issue and recover.

samuelhwilliams commented 4 years ago

I suspect this is a duplicate of https://github.com/samuelhwilliams/Eel/issues/309 (even if not I'd probably look at them together). I will close this in lieu of #309.