Open samuelpilz opened 7 years ago
Is it not possible to detect the disconnect itself? for example if the websocket has been closed by either of the sides?
This is not easily possible with Websockets elm. There is however a Weboscket.LowLevel module, which can handle this. This, however has a far more complicated interface. Just "subscribung" to the close is not easily possible in Websocket
The solution is to listen if there is no answer after a request has been sent via a time-subscription and cancel that if a response has arrived in time.
The client can detect disconnection when not receiving a response after sending a message. This can be displayed.