Mobile apps may control the behavior of websocket connections in unpredictable ways when an app is "backgrounded," e.g. when the user locks the screen or switches to a different app.
Because we cannot be sure how the OS will control the websocket in this condition, we should handle the connection and this event at the app level.
Because some low-level websocket handling is required to accomplish this, we wrap an effective practical solution in convenient public methods, tested in chronik-client.
These methods are implemented in Cashtab
