Skip to content

Commit

Permalink
Merge pull request #14 from takenet/bugfix/client-on-close-connection
Browse files Browse the repository at this point in the history
[Bugfix] WebSocket Closure
  • Loading branch information
mpamaro authored Feb 9, 2023
2 parents 04ee268 + e1ef19a commit dbb554e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.23

* Fix WebSocket closure

## 0.0.22

* Set the whersocket ping interval
Expand Down
6 changes: 3 additions & 3 deletions lib/src/protocol/network/web_socket_transport.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ class WebSocketTransport implements Transport {
// handle errors
onError: (error) {
logger.shout('Error: $error');
socket?.close();
close();
},

// handle server ending connection
onDone: () {
logger.warning('Server closed the connection.');
onConnectionDone?.add(true);
socket?.close();
close();
},
);

Expand All @@ -109,7 +109,7 @@ class WebSocketTransport implements Transport {

@override
Future<void> close() async {
socket?.close();
await socket?.close();
onClose.sink.add(true);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -529,5 +529,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.18.0 <4.0.0"
dart: ">=2.18.0 <3.0.0"
flutter: ">=1.17.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: lime
description: LIME Protocol for Dart/Flutter - A lightweight messaging library
version: 0.0.22
version: 0.0.23
homepage: https://limeprotocol.org/
repository: https://github.com/takenet/lime-dart

Expand Down

0 comments on commit dbb554e

Please sign in to comment.