public abstract class DefaultMaxMessagesRecvByteBufAllocator extends java.lang.Object implements MaxMessagesRecvByteBufAllocator
MaxMessagesRecvByteBufAllocator
,尊重ChannelConfig.isAutoRead()
,还可以防止溢出。
Modifier and Type | Class and Description |
---|---|
class |
DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle
重点强化
DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle.continueReading() 的每个读取条件的最大消息
强度 。
|
RecvByteBufAllocator.DelegatingHandle, RecvByteBufAllocator.ExtendedHandle, RecvByteBufAllocator.Handle
Constructor and Description |
---|
DefaultMaxMessagesRecvByteBufAllocator() |
DefaultMaxMessagesRecvByteBufAllocator(int maxMessagesPerRead) |
Modifier and Type | Method and Description |
---|---|
int |
maxMessagesPerRead()
返回每个读取循环要读取的最大消息数。
|
MaxMessagesRecvByteBufAllocator |
maxMessagesPerRead(int maxMessagesPerRead)
设置每个读取循环要读取的最大消息数。
|
boolean |
respectMaybeMoreData()
如果我们认为没有更多的数据,获取未来
RecvByteBufAllocator.newHandle() 的实例将停止阅读。
|
DefaultMaxMessagesRecvByteBufAllocator |
respectMaybeMoreData(boolean respectMaybeMoreData)
如果我们认为没有更多数据,确定未来的
RecvByteBufAllocator.newHandle() 实例
是否会停止阅读。
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newHandle
public DefaultMaxMessagesRecvByteBufAllocator()
public DefaultMaxMessagesRecvByteBufAllocator(int maxMessagesPerRead)
public int maxMessagesPerRead()
MaxMessagesRecvByteBufAllocator
复制的描述
maxMessagesPerRead
,界面
MaxMessagesRecvByteBufAllocator
public MaxMessagesRecvByteBufAllocator maxMessagesPerRead(int maxMessagesPerRead)
MaxMessagesRecvByteBufAllocator
maxMessagesPerRead
,界面
MaxMessagesRecvByteBufAllocator
public DefaultMaxMessagesRecvByteBufAllocator respectMaybeMoreData(boolean respectMaybeMoreData)
RecvByteBufAllocator.newHandle()
未来的实例
是否会停止阅读。
respectMaybeMoreData
-
true
停止阅读,如果我们认为没有更多的数据。 这可以节省一个系统调用来从套接字中读取数据,但是如果数据以快速的方式到达,我们可能会放弃我们的maxMessagesPerRead()
量程,并且必须等待选择器通知我们更多的数据。 false
继续阅读(最多maxMessagesPerRead()
)或直到我们尝试阅读时没有数据。 this
。
public final boolean respectMaybeMoreData()
RecvByteBufAllocator.newHandle()
实例将停止阅读。
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–2018 The Netty Project. All rights reserved.