Skip to content

Commit

Permalink
Packets can no longer be written to closed channels.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhg023 committed May 30, 2018
1 parent ca07d57 commit 63158f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/simplenet/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,11 @@ private void flush(int i) {
return;
}

if (!channel.isOpen()) {
outgoingPackets.clear();
return;
}

ByteBuffer raw = outgoingPackets.poll();

if (raw == null) {
Expand Down

0 comments on commit 63158f8

Please sign in to comment.