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| Constructor and Description |
|---|
FixedRecvByteBufAllocator(int bufferSize)
Creates a new predictor that always returns the same prediction of
the specified buffer size.
|
| Modifier and Type | Method and Description |
|---|---|
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)
DefaultMaxMessagesRecvByteBufAllocatorRecvByteBufAllocator.newHandle() will stop reading if we think there is no more data.respectMaybeMoreData in class 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.Copyright © 2008–2025 The Netty Project. All rights reserved.