Module io.netty5.transport
Package io.netty5.channel
Class MaxMessagesReadHandleFactory.MaxMessageReadHandle
- java.lang.Object
-
- io.netty5.channel.MaxMessagesReadHandleFactory.MaxMessageReadHandle
-
- All Implemented Interfaces:
ReadHandleFactory.ReadHandle
- Enclosing class:
- MaxMessagesReadHandleFactory
protected abstract static class MaxMessagesReadHandleFactory.MaxMessageReadHandle extends Object implements ReadHandleFactory.ReadHandle
Focuses on enforcing the maximum messages per read condition forlastRead(int, int, int).
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMaxMessageReadHandle(int maxMessagesPerRead)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanlastRead(int attemptedBytesRead, int actualBytesRead, int numMessagesRead)Notify theReadHandleFactory.ReadHandleof the last read operation and its result.voidreadComplete()Method that must be called once the read loop was completed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.ReadHandleFactory.ReadHandle
estimatedBufferCapacity
-
-
-
-
Method Detail
-
lastRead
public boolean lastRead(int attemptedBytesRead, int actualBytesRead, int numMessagesRead)Description copied from interface:ReadHandleFactory.ReadHandleNotify theReadHandleFactory.ReadHandleof the last read operation and its result.- Specified by:
lastReadin interfaceReadHandleFactory.ReadHandle- Parameters:
attemptedBytesRead- The number of bytes the read operation did attempt to read.actualBytesRead- The number of bytes from the previous read operation. This may be negative if a read error occurs.numMessagesRead- The number of messages read.- Returns:
trueif the read loop should continue reading,falseotherwise.
-
readComplete
public void readComplete()
Description copied from interface:ReadHandleFactory.ReadHandleMethod that must be called once the read loop was completed.- Specified by:
readCompletein interfaceReadHandleFactory.ReadHandle
-
-