Skip to content

Commit 63158f8

Browse files
author
jhg023
committed
Packets can no longer be written to closed channels.
1 parent ca07d57 commit 63158f8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/simplenet/Client.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,11 @@ private void flush(int i) {
476476
return;
477477
}
478478

479+
if (!channel.isOpen()) {
480+
outgoingPackets.clear();
481+
return;
482+
}
483+
479484
ByteBuffer raw = outgoingPackets.poll();
480485

481486
if (raw == null) {

0 commit comments

Comments
 (0)