Detect disconnection on the client
samuelpilz opened this issue · comments
Samuel Pilz commented
The client can detect disconnection when not receiving a response after sending a message. This can be displayed.
fendor commented
Is it not possible to detect the disconnect itself? for example if the websocket has been closed by either of the sides?
Samuel Pilz commented
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
Samuel Pilz commented
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.