public abstract class DefaultMaxMessagesRecvByteBufAllocator extends java.lang.Object implements MaxMessagesRecvByteBufAllocator
MaxMessagesRecvByteBufAllocator
which respects ChannelConfig.isAutoRead()
and also prevents overflow.限定符和类型 | 类和说明 |
---|---|
class |
DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle
Focuses on enforcing the maximum messages per read condition for
DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle.continueReading() . |
RecvByteBufAllocator.DelegatingHandle, RecvByteBufAllocator.ExtendedHandle, RecvByteBufAllocator.Handle
构造器和说明 |
---|
DefaultMaxMessagesRecvByteBufAllocator() |
DefaultMaxMessagesRecvByteBufAllocator(int maxMessagesPerRead) |
限定符和类型 | 方法和说明 |
---|---|
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, wait
newHandle
public DefaultMaxMessagesRecvByteBufAllocator()
public DefaultMaxMessagesRecvByteBufAllocator(int maxMessagesPerRead)
public int maxMessagesPerRead()
MaxMessagesRecvByteBufAllocator
channelRead()
event.
If this value is greater than 1, an event loop might attempt to read multiple times to procure multiple messages.public MaxMessagesRecvByteBufAllocator maxMessagesPerRead(int maxMessagesPerRead)
MaxMessagesRecvByteBufAllocator
public 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.