In html/js/remote.js we keep an EventSource connection to remote.js to listen to commands. This connection has a 50s timeout as a heartbeat mechanism, i.e. remote.js just assumes disconnection if there’s no reconnection after the 50s.
After this timeout, it takes EventSource in Chrome about 3s to reconnect. Currently, any commands sent during those 3s get ignored.
This could be fixed by one of these options.
Have remote.js remember every command for say 10s. Any new connections made during those 10s get the stored commands. However, we need to prevent a restart command from causing an infinite loop.
Have remote.js announce a timeout with an ID, allowing the client to send a GET request to /keepalive?id=ID in time to keep the connection alive.
Workaround: send each command twice with a 5s delay to make sure the client has received it.
In
html/js/remote.js
we keep an EventSource connection toremote.js
to listen to commands. This connection has a 50s timeout as a heartbeat mechanism, i.e.remote.js
just assumes disconnection if there’s no reconnection after the 50s.After this timeout, it takes EventSource in Chrome about 3s to reconnect. Currently, any commands sent during those 3s get ignored.
This could be fixed by one of these options.
remote.js
remember every command for say 10s. Any new connections made during those 10s get the stored commands. However, we need to prevent arestart
command from causing an infinite loop.remote.js
announce a timeout with an ID, allowing the client to send a GET request to/keepalive?id=ID
in time to keep the connection alive.Workaround: send each command twice with a 5s delay to make sure the client has received it.