Set maxMessagesPerRead to 16 by default in epoll transport to be consistent with NIO.

Motivation:

DefaultChannelConfig has a "hack" which will automatically set maxMessagesPerRead to 16 when constructed when either a ServerChannel or a AbstractNioByteChannel is used. As this instanceof check will fail with epoll we should set it there as well.

Modifications:

Set maxMessagesPerRead to 16 by default in EpollDomainSocketChannelConfig and EpollSocketChannelConfig.

Result:

More consistent behavior between epoll and nio when LT mode is used.
This commit is contained in:
Norman Maurer 2016-07-15 09:53:51 +02:00
parent 45f9d29fc1
commit 9ba64805b0
2 changed files with 4 additions and 0 deletions

View File

@ -30,6 +30,8 @@ public final class EpollDomainSocketChannelConfig extends EpollChannelConfig
EpollDomainSocketChannelConfig(AbstractEpollChannel channel) {
super(channel);
// Make it consistent with NIO.
setMaxMessagesPerRead(16);
}
@Override

View File

@ -44,6 +44,8 @@ public final class EpollSocketChannelConfig extends EpollChannelConfig implement
if (PlatformDependent.canEnableTcpNoDelayByDefault()) {
setTcpNoDelay(true);
}
// Make it consistent with NIO.
setMaxMessagesPerRead(16);
}
@Override