8287580: (se) CancelledKeyException during channel registration

Reviewed-by: alanb
This commit is contained in:
Brian Burkhalter 2022-06-23 15:39:32 +00:00
parent b8db0c383b
commit 72f286a9ba
2 changed files with 70 additions and 0 deletions

View file

@ -26,6 +26,7 @@
package sun.nio.ch;
import java.io.IOException;
import java.nio.channels.CancelledKeyException;
import java.nio.channels.ClosedSelectorException;
import java.nio.channels.IllegalSelectorException;
import java.nio.channels.SelectableChannel;
@ -225,6 +226,7 @@ public abstract class SelectorImpl
keys.remove(k);
k.cancel();
throw e;
} catch (CancelledKeyException ignored) {
}
return k;
}