[#857] Correctly handle CancelledKeyException

This commit is contained in:
Norman Maurer 2012-12-27 22:24:07 +01:00
parent 5adb37de3d
commit 5a4a52a817

View File

@ -400,7 +400,7 @@ public final class NioEventLoop extends SingleThreadEventLoop {
unsafe.finishConnect();
}
} catch (CancelledKeyException e) {
if (readyOps != 1 && (readyOps & SelectionKey.OP_WRITE) != 0) {
if (readyOps != -1 && (readyOps & SelectionKey.OP_WRITE) != 0) {
unregisterWritableTasks(ch);
}
unsafe.close(unsafe.voidFuture());