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();
|
assert eventLoop().inEventLoop();
|
||||||
final SelectionKey key = selectionKey();
|
final SelectionKey key = selectionKey();
|
||||||
if (!config().isAutoRead()) {
|
if (!config().isAutoRead()) {
|
||||||
|
int interestOps = key.interestOps();
|
||||||
|
if ((interestOps & readInterestOp) != 0) {
|
||||||
// only remove readInterestOp if needed
|
// only remove readInterestOp if needed
|
||||||
key.interestOps(key.interestOps() & ~readInterestOp);
|
key.interestOps(interestOps & ~readInterestOp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final ChannelPipeline pipeline = pipeline();
|
final ChannelPipeline pipeline = pipeline();
|
||||||
@ -73,9 +76,13 @@ public abstract class AbstractNioMessageChannel extends AbstractNioChannel {
|
|||||||
closed = true;
|
closed = true;
|
||||||
break loop;
|
break loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reads++ > READ_BATCH_SIZE) {
|
if (reads++ > READ_BATCH_SIZE) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!config().isAutoRead()) {
|
||||||
|
break loop;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
if (read) {
|
if (read) {
|
||||||
|
Loading…
Reference in New Issue
Block a user