Class FixedRecvByteBufAllocator
java.lang.Object
io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator
io.netty.channel.FixedRecvByteBufAllocator
- All Implemented Interfaces:
MaxMessagesRecvByteBufAllocator, RecvByteBufAllocator
The
RecvByteBufAllocator that always yields the same buffer
size prediction. This predictor ignores the feed back from the I/O thread.-
Nested Class Summary
Nested classes/interfaces inherited from class DefaultMaxMessagesRecvByteBufAllocator
DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandleNested classes/interfaces inherited from interface RecvByteBufAllocator
RecvByteBufAllocator.DelegatingHandle, RecvByteBufAllocator.ExtendedHandle, RecvByteBufAllocator.Handle -
Constructor Summary
ConstructorsConstructorDescriptionFixedRecvByteBufAllocator(int bufferSize) Creates a new predictor that always returns the same prediction of the specified buffer size. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new handle.respectMaybeMoreData(boolean respectMaybeMoreData) Determine if future instances ofRecvByteBufAllocator.newHandle()will stop reading if we think there is no more data.Methods inherited from class DefaultMaxMessagesRecvByteBufAllocator
maxMessagesPerRead, maxMessagesPerRead, respectMaybeMoreData
-
Constructor Details
-
FixedRecvByteBufAllocator
public FixedRecvByteBufAllocator(int bufferSize) Creates a new predictor that always returns the same prediction of the specified buffer size.
-
-
Method Details
-
newHandle
Description copied from interface:RecvByteBufAllocatorCreates a new handle. The handle provides the actual operations and keeps the internal information which is required for predicting an optimal buffer capacity. -
respectMaybeMoreData
Description copied from class:DefaultMaxMessagesRecvByteBufAllocatorDetermine if future instances ofRecvByteBufAllocator.newHandle()will stop reading if we think there is no more data.- Overrides:
respectMaybeMoreDatain classDefaultMaxMessagesRecvByteBufAllocator- Parameters:
respectMaybeMoreData-trueto 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 ourDefaultMaxMessagesRecvByteBufAllocator.maxMessagesPerRead()quantum and have to wait for the selector to notify us of more data.falseto keep reading (up toDefaultMaxMessagesRecvByteBufAllocator.maxMessagesPerRead()) or until there is no data when we attempt to read.
- Returns:
this.
-