We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee3c210 commit 05fb852Copy full SHA for 05fb852
1 file changed
src/org/java_websocket/WebSocketServer.java
@@ -5,6 +5,7 @@
5
import java.net.InetSocketAddress;
6
import java.net.UnknownHostException;
7
import java.nio.ByteBuffer;
8
+import java.nio.channels.CancelledKeyException;
9
import java.nio.channels.SelectionKey;
10
import java.nio.channels.Selector;
11
import java.nio.channels.ServerSocketChannel;
@@ -212,6 +213,8 @@ public void run() {
212
213
}
214
215
216
+ } catch ( CancelledKeyException e ) {
217
+ // an other thread may cancel the key
218
} catch ( IOException ex ) {
219
if( key != null )
220
key.cancel();
0 commit comments