From 63158f8dbea2916712596922f4af7bfd03e91d09 Mon Sep 17 00:00:00 2001 From: jhg023 Date: Wed, 30 May 2018 12:40:54 -0400 Subject: [PATCH] Packets can no longer be written to closed channels. --- src/main/java/simplenet/Client.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/simplenet/Client.java b/src/main/java/simplenet/Client.java index 963fabd..b269277 100644 --- a/src/main/java/simplenet/Client.java +++ b/src/main/java/simplenet/Client.java @@ -476,6 +476,11 @@ private void flush(int i) { return; } + if (!channel.isOpen()) { + outgoingPackets.clear(); + return; + } + ByteBuffer raw = outgoingPackets.poll(); if (raw == null) {