samuelpilz / core-catcher

MIT License
3 stars 0 forks source link

Detect disconnection on the client #33

Open samuelpilz opened 7 years ago

samuelpilz commented 7 years ago

The client can detect disconnection when not receiving a response after sending a message. This can be displayed.

fendor commented 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?

samuelpilz commented 7 years ago

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

samuelpilz commented 7 years ago

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.