Fix simple NetMarshalClient bug.
Oops
This commit is contained in:
parent
1285317289
commit
3934e2e861
@ -441,7 +441,7 @@ public class NetMarshalClient implements Closeable {
|
|||||||
*/
|
*/
|
||||||
public IPacket receivePacket() throws InterruptedException {
|
public IPacket receivePacket() throws InterruptedException {
|
||||||
synchronized (slockReceive) {
|
synchronized (slockReceive) {
|
||||||
while (receivedPackets.size() < 1) slockReceive.wait();
|
while (running && receivedPackets.size() < 1) slockReceive.wait();
|
||||||
return receivedPackets.poll();
|
return receivedPackets.poll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -616,6 +616,9 @@ public class NetMarshalClient implements Closeable {
|
|||||||
fragmentFinishSendMonitorThread.interrupt();
|
fragmentFinishSendMonitorThread.interrupt();
|
||||||
}
|
}
|
||||||
receivedPackets.clear();
|
receivedPackets.clear();
|
||||||
|
synchronized (slockReceive) {
|
||||||
|
slockReceive.notifyAll();
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
inputStream.close();
|
inputStream.close();
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
Reference in New Issue
Block a user