Skip to content

Commit

Permalink
Improve websocket connection state handling. Increase min platform ve…
Browse files Browse the repository at this point in the history
…rsion to 3620.
  • Loading branch information
ikulikov committed Dec 13, 2023
1 parent da77dcf commit de8aff6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/src/model/version.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class PlatformVersionMatcher {
static const int minPlatformVersionInt = 3600;
static const int minPlatformVersionInt = 3620;

static bool isSupportedPlatformVersion(PlatformVersion platformVersion) {
try {
Expand Down
6 changes: 5 additions & 1 deletion lib/src/service/telemetry_websocket_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,19 @@ class TelemetryWebsocketService implements TelemetryService {
try {
var channel = WebSocketChannel.connect(_telemetryUri);
_sink = channel.sink;
channel.ready.then((value) => _onOpen(token), onError: ((e, stackTrace) {
_onError(e);
_onClose(channel);
}));
channel.stream.listen((event) {
_onMessage(event);
}, onDone: () {
_onClose(channel);
}, onError: (e) {
_onError(e);
});
_onOpen(token);
} catch (e) {
_onError(e);
_onClose();
}
}
Expand Down

0 comments on commit de8aff6

Please sign in to comment.