[#2164] Only reregister SelectionKeys that are still valid

This commit is contained in:
Norman Maurer 2014-01-29 07:18:29 +01:00
parent 143951ac5f
commit 96f94cfcb1

View File

@ -253,7 +253,7 @@ public final class NioEventLoop extends SingleThreadEventLoop {
for (SelectionKey key: oldSelector.keys()) { for (SelectionKey key: oldSelector.keys()) {
Object a = key.attachment(); Object a = key.attachment();
try { try {
if (key.channel().keyFor(newSelector) != null) { if (!key.isValid() || key.channel().keyFor(newSelector) != null) {
continue; continue;
} }