There needs to be strong systems in place to start up and shutdown hermes, in sync with the browser usage.
If using CEF, this is relatively straightforward. Start the server, start CEF pointed at the server, when the CEF process shuts down, shut down the server. There are still issues you try to open hermes a second time (we should detect this and instead of trying to open a second instance, we should bring the first instance to focus).
If not using CEF, the process looks like: Start the server, open a browser window pointed at the server, user closes browser window, ???
??? can be handled by:
detecting the onclose event (what if someone opens a second window?)
having a button on every page allowing people to shut down the server (what if someone closes their browser window first?)
having the browser ping the server every 10 seconds and having the server shutdown if it doesn't see a ping for 30 seconds (I'm sure there's something wrong with this but this gracefully handles all of the above situations)
As alluded to in the CEF case there are issues of trying to open hermes twice. Similarly, hermes doesn't handle having two browser window sessions hitting the server because state is stored in cookies that are shared between all browser windows. Maybe hermes should detect this and pop up a message saying that the old browser tab has been deactivated?
There needs to be strong systems in place to start up and shutdown hermes, in sync with the browser usage.
If using CEF, this is relatively straightforward. Start the server, start CEF pointed at the server, when the CEF process shuts down, shut down the server. There are still issues you try to open hermes a second time (we should detect this and instead of trying to open a second instance, we should bring the first instance to focus).
If not using CEF, the process looks like: Start the server, open a browser window pointed at the server, user closes browser window, ???
??? can be handled by:
As alluded to in the CEF case there are issues of trying to open hermes twice. Similarly, hermes doesn't handle having two browser window sessions hitting the server because state is stored in cookies that are shared between all browser windows. Maybe hermes should detect this and pop up a message saying that the old browser tab has been deactivated?