pepper icon indicating copy to clipboard operation
pepper copied to clipboard

Restore connection on reconnect

Open elliotchance opened this issue 6 years ago • 0 comments

Websockets can be flakey and the idea of the websocket dropping out for even a moment would be disastrous. I believe this can easily be resolved by:

  1. When a client connects it should send an identifier back.
  2. The connections should be held in a global map. Only expiring/removing connections sometime after they have disconnected (like 10 minutes, or more).
  3. When a client connects with a previous identifier it can use that connection instead of calling the newConnectionFn.

This way all state is maintained through dropouts.

elliotchance avatar Jul 06 '19 05:07 elliotchance