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.MaxMessageHandleModifier and TypeClassDescriptionclassFocuses on enforcing the maximum messages per read condition forDefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle.continueReading().Nested classes/interfaces inherited from interface RecvByteBufAllocator
RecvByteBufAllocator.DelegatingHandle, RecvByteBufAllocator.ExtendedHandle, RecvByteBufAllocator.HandleModifier and TypeInterfaceDescriptionstatic classARecvByteBufAllocator.Handlewhich delegates all call to some otherRecvByteBufAllocator.Handle.static interfacestatic interfaceDeprecated. -
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, respectMaybeMoreDataModifier and TypeMethodDescriptionintReturns the maximum number of messages to read per read loop. achannelRead()event.maxMessagesPerRead(int maxMessagesPerRead) Sets the maximum number of messages to read per read loop.final booleanGet if future instances ofRecvByteBufAllocator.newHandle()will stop reading if we think there is no more data.
-
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.
-
RecvByteBufAllocator.ExtendedHandle.