Make sure that setAutoRead(false) has a direct effect and only update interestedOps if needed
This commit is contained in:
parent
252bd25855
commit
d31ccebd62
@ -50,8 +50,11 @@ public abstract class AbstractNioMessageChannel extends AbstractNioChannel {
|
||||
assert eventLoop().inEventLoop();
|
||||
final SelectionKey key = selectionKey();
|
||||
if (!config().isAutoRead()) {
|
||||
// only remove readInterestOp if needed
|
||||
key.interestOps(key.interestOps() & ~readInterestOp);
|
||||
int interestOps = key.interestOps();
|
||||
if ((interestOps & readInterestOp) != 0) {
|
||||
// only remove readInterestOp if needed
|
||||
key.interestOps(interestOps & ~readInterestOp);
|
||||
}
|
||||
}
|
||||
|
||||
final ChannelPipeline pipeline = pipeline();
|
||||
@ -73,9 +76,13 @@ public abstract class AbstractNioMessageChannel extends AbstractNioChannel {
|
||||
closed = true;
|
||||
break loop;
|
||||
}
|
||||
|
||||
if (reads++ > READ_BATCH_SIZE) {
|
||||
break;
|
||||
}
|
||||
if (!config().isAutoRead()) {
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
if (read) {
|
||||
|
Loading…
Reference in New Issue
Block a user