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.MaxMessageHandle
RecvByteBufAllocator.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, respectMaybeMoreData
public FixedRecvByteBufAllocator(int bufferSize)
public RecvByteBufAllocator.Handle newHandle()
RecvByteBufAllocator
public FixedRecvByteBufAllocator respectMaybeMoreData(boolean respectMaybeMoreData)
DefaultMaxMessagesRecvByteBufAllocator
RecvByteBufAllocator.newHandle()
will stop reading if we think there is no more data.respectMaybeMoreData
in class DefaultMaxMessagesRecvByteBufAllocator
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 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–2023 The Netty Project. All rights reserved.