Fixed issue: NETTY-224 CancelledKeyException on Channel.setReadable() in NIO transport
* Handled CancelledKeyException properly
This commit is contained in:
parent
edd056d3de
commit
8a0f8e9d78
@ -803,6 +803,11 @@ class NioDatagramWorker implements Runnable {
|
||||
channel.setRawInterestOpsNow(interestOps);
|
||||
fireChannelInterestChanged(channel);
|
||||
}
|
||||
} catch (final CancelledKeyException e) {
|
||||
// setInterestOps() was called on a closed channel.
|
||||
ClosedChannelException cce = new ClosedChannelException();
|
||||
future.setFailure(cce);
|
||||
fireExceptionCaught(channel, cce);
|
||||
} catch (final Throwable t) {
|
||||
future.setFailure(t);
|
||||
fireExceptionCaught(channel, t);
|
||||
|
@ -711,6 +711,11 @@ class NioWorker implements Runnable {
|
||||
channel.setRawInterestOpsNow(interestOps);
|
||||
fireChannelInterestChanged(channel);
|
||||
}
|
||||
} catch (CancelledKeyException e) {
|
||||
// setInterestOps() was called on a closed channel.
|
||||
ClosedChannelException cce = new ClosedChannelException();
|
||||
future.setFailure(cce);
|
||||
fireExceptionCaught(channel, cce);
|
||||
} catch (Throwable t) {
|
||||
future.setFailure(t);
|
||||
fireExceptionCaught(channel, t);
|
||||
|
Loading…
x
Reference in New Issue
Block a user