Skip to content

Commit

Permalink
update.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Dec 10, 2024
1 parent 991e87e commit 63e5d3a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
4 changes: 1 addition & 3 deletions lib/src/core/engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -964,9 +964,7 @@ class Engine extends Disposable with EventsEmittable<EngineEvent> {
})
..on<SignalDisconnectedEvent>((event) async {
logger.fine('Signal disconnected ${event.reason}');
if ((event.reason == DisconnectReason.disconnected ||
event.reason == DisconnectReason.noInternetConnection) &&
!_isClosed) {
if (event.reason == DisconnectReason.disconnected && !_isClosed) {
await handleDisconnect(ClientDisconnectReason.signal);
} else {
events.emit(EngineDisconnectedEvent(
Expand Down
11 changes: 2 additions & 9 deletions lib/src/core/signal_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,10 @@ class SignalClient extends Disposable with EventsEmittable<SignalEvent> {
}
});

/// If there is no internet connection, emit [SignalDisconnectedEvent]
if (_connectivityResult.contains(ConnectivityResult.none)) {
logger.warning('no internet connection');
events.emit(SignalDisconnectedEvent(
reason: DisconnectReason.noInternetConnection));
if (!reconnect) {
throw ConnectException('no internet connection',
reason: ConnectionErrorReason.InternalError, statusCode: 503);
} else {
return;
}
throw ConnectException('no internet connection',
reason: ConnectionErrorReason.InternalError, statusCode: 503);
}
}

Expand Down
1 change: 0 additions & 1 deletion lib/src/types/other.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ enum DisconnectReason {
joinFailure,
disconnected,
signalingConnectionFailure,
noInternetConnection,
reconnectAttemptsExceeded,
}

Expand Down

0 comments on commit 63e5d3a

Please sign in to comment.