felangel / felangel/web_socket_client

feat: reconnect on network change or app wake

Đang mở
#9 9 bình luận 10 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Dart
Star
177
Fork
44
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I have used this package to replace some custom reconnect code because I think it does a better job than we were doing. However one issue with the this package is that when the network switches, from Wifi to Cellular for example, there is no reconnection attempt made because often the WebSocket class doesn't register it as a dropped connection. My fix was to use the [connectivity_plus](https://pub.dev/packages/connectivity_plus) package to look for changes to the network, ignoring changes to and from **no connection** since this package already handles disconnects, to create a reliable long running websocket connection.

There are also issues where a websocket connection will stop responding after the app has gone into the background but hasn't been unloaded from memory. In this case we need to check if the app has resumed and assume that after a certain amount of time it has been paused that we should force a reconnect.

It would be great if this client could handle those cases, because maintaining a reliable websocket connection in flutter isn't easy.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.