Skip to content

Commit 33d2dc9

Browse files
committed
Fix #23 [BUG] Calling close on Server raises ConcurrentModificationError
1 parent 56f7e3a commit 33d2dc9

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.9.4
2+
3+
**Bug Fix:**
4+
5+
* [#23](https://github.com/rikulo/socket.io-dart/issues/23) [BUG] Calling close on Server raises ConcurrentModificationError
6+
17
## 0.9.3
28

39
**Bug Fix:**

lib/src/engine/server.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class Server extends Engine {
176176
@override
177177
void close() {
178178
_logger.fine('closing all open clients');
179-
for (var key in clients.keys) {
179+
for (var key in clients.keys.toList(growable: false)) {
180180
if (clients[key] != null) {
181181
clients[key].close(true);
182182
}

lib/src/server.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ class Server {
371371
///
372372
/// @api public
373373
void close() {
374-
nsps['/'].sockets.forEach((socket) {
374+
nsps['/'].sockets.toList(growable: false).forEach((socket) {
375375
socket.onclose();
376376
});
377377

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: socket_io
22
description: >
33
Port of JS/Node library Socket.io. It enables real-time, bidirectional and
44
event-based communication cross-platform.
5-
version: 0.9.3
5+
version: 0.9.4
66
author: jumperchen <[email protected]>
77
homepage: https://www.zkoss.org
88
repository: https://github.com/rikulo/socket.io-dart

0 commit comments

Comments
 (0)