public abstract class DefaultMaxMessagesRecvByteBufAllocator extends Object implements MaxMessagesRecvByteBufAllocator
MaxMessagesRecvByteBufAllocator which respects ChannelConfig.isAutoRead()
and also prevents overflow.| Modifier and Type | Class and Description |
|---|---|
class |
DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle
Focuses on enforcing the maximum messages per read condition for
DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle.continueReading(). |
RecvByteBufAllocator.DelegatingHandle, RecvByteBufAllocator.ExtendedHandle, RecvByteBufAllocator.Handle| Constructor and Description |
|---|
DefaultMaxMessagesRecvByteBufAllocator() |
DefaultMaxMessagesRecvByteBufAllocator(int maxMessagesPerRead) |
| Modifier and Type | Method and Description |
|---|---|
int |
maxMessagesPerRead()
Returns the maximum number of messages to read per read loop.
|
MaxMessagesRecvByteBufAllocator |
maxMessagesPerRead(int maxMessagesPerRead)
Sets the maximum number of messages to read per read loop.
|
boolean |
respectMaybeMoreData()
Get if future instances of
RecvByteBufAllocator.newHandle() will stop reading if we think there is no more data. |
DefaultMaxMessagesRecvByteBufAllocator |
respectMaybeMoreData(boolean respectMaybeMoreData)
Determine if future instances of
RecvByteBufAllocator.newHandle() will stop reading if we think there is no more data. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnewHandlepublic DefaultMaxMessagesRecvByteBufAllocator()
public DefaultMaxMessagesRecvByteBufAllocator(int maxMessagesPerRead)
public int maxMessagesPerRead()
MaxMessagesRecvByteBufAllocatorchannelRead() event.
If this value is greater than 1, an event loop might attempt to read multiple times to procure multiple messages.maxMessagesPerRead in interface MaxMessagesRecvByteBufAllocatorpublic MaxMessagesRecvByteBufAllocator maxMessagesPerRead(int maxMessagesPerRead)
MaxMessagesRecvByteBufAllocatormaxMessagesPerRead in interface MaxMessagesRecvByteBufAllocatorpublic DefaultMaxMessagesRecvByteBufAllocator respectMaybeMoreData(boolean respectMaybeMoreData)
RecvByteBufAllocator.newHandle() will stop reading if we think there is no more data.respectMaybeMoreData - true to stop reading if we think there is no more data. This may save a system call to read from
the socket, but if data has arrived in a racy fashion we may give up our maxMessagesPerRead()
quantum and have to wait for the selector to notify us of more data.false to keep reading (up to maxMessagesPerRead()) or until there is no data when we
attempt to read.this.public final boolean respectMaybeMoreData()
RecvByteBufAllocator.newHandle() will stop reading if we think there is no more data.true to stop reading if we think there is no more data. This may save a system call to read from
the socket, but if data has arrived in a racy fashion we may give up our maxMessagesPerRead()
quantum and have to wait for the selector to notify us of more data.false to keep reading (up to maxMessagesPerRead()) or until there is no data when we
attempt to read.Copyright © 2008–2025 The Netty Project. All rights reserved.