Skip to content

Commit 05fb852

Browse files
committed
caught uncaught exception
1 parent ee3c210 commit 05fb852

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/org/java_websocket/WebSocketServer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.net.InetSocketAddress;
66
import java.net.UnknownHostException;
77
import java.nio.ByteBuffer;
8+
import java.nio.channels.CancelledKeyException;
89
import java.nio.channels.SelectionKey;
910
import java.nio.channels.Selector;
1011
import java.nio.channels.ServerSocketChannel;
@@ -212,6 +213,8 @@ public void run() {
212213
}
213214
}
214215
}
216+
} catch ( CancelledKeyException e ) {
217+
// an other thread may cancel the key
215218
} catch ( IOException ex ) {
216219
if( key != null )
217220
key.cancel();

0 commit comments

Comments
 (0)