Skip to content

Commit 158b9bc

Browse files
committed
applied fix submitted by @DeHecht ( TooTallNate#191 )
1 parent a2e09f1 commit 158b9bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎src/main/java/org/java_websocket/server/WebSocketServer.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
importjava.nio.ByteBuffer;
99
importjava.nio.channels.ByteChannel;
1010
importjava.nio.channels.CancelledKeyException;
11+
importjava.nio.channels.ClosedByInterruptException;
1112
importjava.nio.channels.SelectableChannel;
1213
importjava.nio.channels.SelectionKey;
1314
importjava.nio.channels.Selector;
@@ -368,6 +369,8 @@ public void run(){
368369
}
369370
} catch ( CancelledKeyExceptione ){
370371
// an other thread may cancel the key
372+
} catch ( ClosedByInterruptExceptione ){
373+
return; // do the same stuff as when InterruptedException is thrown
371374
} catch ( IOExceptionex ){
372375
if( key != null )
373376
key.cancel();

0 commit comments

Comments
(0)