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
import java.nio.ByteBuffer;
99
import java.nio.channels.ByteChannel;
1010
import java.nio.channels.CancelledKeyException;
11+
import java.nio.channels.ClosedByInterruptException;
1112
import java.nio.channels.SelectableChannel;
1213
import java.nio.channels.SelectionKey;
1314
import java.nio.channels.Selector;
@@ -368,6 +369,8 @@ public void run() {
368369
}
369370
} catch ( CancelledKeyException e ) {
370371
// an other thread may cancel the key
372+
} catch ( ClosedByInterruptException e ) {
373+
return; // do the same stuff as when InterruptedException is thrown
371374
} catch ( IOException ex ) {
372375
if( key != null )
373376
key.cancel();

0 commit comments

Comments
 (0)