Skip to content

Commit

Permalink
Fix #23 [BUG] Calling close on Server raises ConcurrentModificationError
Browse files Browse the repository at this point in the history
  • Loading branch information
jumperchen committed Jun 19, 2020
1 parent 56f7e3a commit 33d2dc9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.9.4

**Bug Fix:**

* [#23](https://github.com/rikulo/socket.io-dart/issues/23) [BUG] Calling close on Server raises ConcurrentModificationError

## 0.9.3

**Bug Fix:**
Expand Down
2 changes: 1 addition & 1 deletion lib/src/engine/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class Server extends Engine {
@override
void close() {
_logger.fine('closing all open clients');
for (var key in clients.keys) {
for (var key in clients.keys.toList(growable: false)) {
if (clients[key] != null) {
clients[key].close(true);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ class Server {
///
/// @api public
void close() {
nsps['/'].sockets.forEach((socket) {
nsps['/'].sockets.toList(growable: false).forEach((socket) {
socket.onclose();
});

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: socket_io
description: >
Port of JS/Node library Socket.io. It enables real-time, bidirectional and
event-based communication cross-platform.
version: 0.9.3
version: 0.9.4
author: jumperchen <[email protected]>
homepage: https://www.zkoss.org
repository: https://github.com/rikulo/socket.io-dart
Expand Down

0 comments on commit 33d2dc9

Please sign in to comment.