From 3934e2e86144d4f1911a145d06af5b7200d5f4b9 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Sat, 20 May 2023 19:50:13 +0100 Subject: [PATCH] Fix simple NetMarshalClient bug. Oops --- src/com/captainalm/lib/calmnet/marshal/NetMarshalClient.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/captainalm/lib/calmnet/marshal/NetMarshalClient.java b/src/com/captainalm/lib/calmnet/marshal/NetMarshalClient.java index e6899f9..7bc7dea 100644 --- a/src/com/captainalm/lib/calmnet/marshal/NetMarshalClient.java +++ b/src/com/captainalm/lib/calmnet/marshal/NetMarshalClient.java @@ -441,7 +441,7 @@ public class NetMarshalClient implements Closeable { */ public IPacket receivePacket() throws InterruptedException { synchronized (slockReceive) { - while (receivedPackets.size() < 1) slockReceive.wait(); + while (running && receivedPackets.size() < 1) slockReceive.wait(); return receivedPackets.poll(); } } @@ -616,6 +616,9 @@ public class NetMarshalClient implements Closeable { fragmentFinishSendMonitorThread.interrupt(); } receivedPackets.clear(); + synchronized (slockReceive) { + slockReceive.notifyAll(); + } try { inputStream.close(); } finally {