From 7a333dda9fdc71ab5622cb6ee776ffcd1c7a5efd Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Mon, 14 Nov 2011 10:51:25 +0000 Subject: [PATCH] On some platforms the selector will not automatically wake up when the network connection has been closed. Forcing the selector to wake up seems to be safe on tested platforms. Thanks to @philotomy for the catch and fix. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8669 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../networking/com/jme3/network/kernel/tcp/SelectorKernel.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/src/networking/com/jme3/network/kernel/tcp/SelectorKernel.java b/engine/src/networking/com/jme3/network/kernel/tcp/SelectorKernel.java index 659591764..cd1161c53 100644 --- a/engine/src/networking/com/jme3/network/kernel/tcp/SelectorKernel.java +++ b/engine/src/networking/com/jme3/network/kernel/tcp/SelectorKernel.java @@ -265,6 +265,9 @@ public class SelectorKernel extends AbstractKernel // Make sure the channel is closed serverChannel.close(); + // Force the selector to stop blocking + wakeupSelector(); + // And wait for it join(); }