public class FixedRecvByteBufAllocator extends DefaultMaxMessagesRecvByteBufAllocator
RecvByteBufAllocator that always yields the same buffer
size prediction. This predictor ignores the feed back from the I/O thread.DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandleRecvByteBufAllocator.DelegatingHandle, RecvByteBufAllocator.ExtendedHandle, RecvByteBufAllocator.Handle| 构造器和说明 |
|---|
FixedRecvByteBufAllocator(int bufferSize)
Creates a new predictor that always returns the same prediction of
the specified buffer size.
|
| 限定符和类型 | 方法和说明 |
|---|---|
RecvByteBufAllocator.Handle |
newHandle()
Creates a new handle.
|
FixedRecvByteBufAllocator |
respectMaybeMoreData(boolean respectMaybeMoreData)
Determine if future instances of
RecvByteBufAllocator.newHandle() will stop reading if we think there is no more data. |
maxMessagesPerRead, maxMessagesPerRead, respectMaybeMoreDatapublic FixedRecvByteBufAllocator(int bufferSize)
public RecvByteBufAllocator.Handle newHandle()
RecvByteBufAllocatorpublic FixedRecvByteBufAllocator respectMaybeMoreData(boolean respectMaybeMoreData)
RecvByteBufAllocator.newHandle() will stop reading if we think there is no more data.respectMaybeMoreData 在类中 DefaultMaxMessagesRecvByteBufAllocatorrespectMaybeMoreData - 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 DefaultMaxMessagesRecvByteBufAllocator.maxMessagesPerRead()
quantum and have to wait for the selector to notify us of more data.false to keep reading (up to DefaultMaxMessagesRecvByteBufAllocator.maxMessagesPerRead()) or until there is no data when we
attempt to read.this.