[#857] Check if the SelectionKey is valid before access readyOps()
This commit is contained in:
parent
64351ad7d6
commit
e2b240799c
@ -383,6 +383,12 @@ public final class NioEventLoop extends SingleThreadEventLoop {
|
||||
|
||||
private static void processSelectedKey(SelectionKey k, AbstractNioChannel ch) {
|
||||
final NioUnsafe unsafe = ch.unsafe();
|
||||
if (!k.isValid()) {
|
||||
// close the channel if the key is not valid anymore
|
||||
unsafe.close(unsafe.voidFuture());
|
||||
return;
|
||||
}
|
||||
|
||||
int readyOps = -1;
|
||||
try {
|
||||
readyOps = k.readyOps();
|
||||
|
Loading…
x
Reference in New Issue
Block a user