Package io.netty.channel.uring
Class IoUringRecvByteAllocatorHandle
- java.lang.Object
-
- io.netty.channel.RecvByteBufAllocator.DelegatingHandle
-
- io.netty.channel.uring.IoUringRecvByteAllocatorHandle
-
- All Implemented Interfaces:
RecvByteBufAllocator.ExtendedHandle,RecvByteBufAllocator.Handle
final class IoUringRecvByteAllocatorHandle extends RecvByteBufAllocator.DelegatingHandle implements RecvByteBufAllocator.ExtendedHandle
-
-
Field Summary
Fields Modifier and Type Field Description private UncheckedBooleanSupplierdefaultSupplierprivate booleanfirstReadprivate PreferredDirectByteBufAllocatorpreferredDirectByteBufAllocatorprivate booleanrdHupReceivedprivate booleanreadComplete
-
Constructor Summary
Constructors Constructor Description IoUringRecvByteAllocatorHandle(RecvByteBufAllocator.ExtendedHandle handle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufallocate(ByteBufAllocator alloc)Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough not to waste its space.booleancontinueReading()Determine if the current read loop should continue.booleancontinueReading(UncheckedBooleanSupplier maybeMoreDataSupplier)Same asRecvByteBufAllocator.Handle.continueReading()except "more data" is determined by the supplier parameter.voidincMessagesRead(int numMessages)Increment the number of messages that have been read for the current read loop.booleanisFirstRead()(package private) booleanisReadComplete()voidlastBytesRead(int bytes)Set the bytes that have been read for the last read operation.(package private) voidrdHupReceived()voidreadComplete()The read has completed.voidreset(ChannelConfig config)Reset any counters that have accumulated and recommend how many messages/bytes should be read for the next read loop.-
Methods inherited from class io.netty.channel.RecvByteBufAllocator.DelegatingHandle
attemptedBytesRead, attemptedBytesRead, delegate, guess, lastBytesRead
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.channel.RecvByteBufAllocator.Handle
attemptedBytesRead, attemptedBytesRead, guess, lastBytesRead
-
-
-
-
Field Detail
-
preferredDirectByteBufAllocator
private final PreferredDirectByteBufAllocator preferredDirectByteBufAllocator
-
defaultSupplier
private final UncheckedBooleanSupplier defaultSupplier
-
firstRead
private boolean firstRead
-
rdHupReceived
private boolean rdHupReceived
-
readComplete
private boolean readComplete
-
-
Constructor Detail
-
IoUringRecvByteAllocatorHandle
IoUringRecvByteAllocatorHandle(RecvByteBufAllocator.ExtendedHandle handle)
-
-
Method Detail
-
reset
public void reset(ChannelConfig config)
Description copied from interface:RecvByteBufAllocator.HandleReset any counters that have accumulated and recommend how many messages/bytes should be read for the next read loop.This may be used by
This is only ever a hint and may be ignored by the implementation.RecvByteBufAllocator.Handle.continueReading()to determine if the read operation should complete.- Specified by:
resetin interfaceRecvByteBufAllocator.Handle- Overrides:
resetin classRecvByteBufAllocator.DelegatingHandle- Parameters:
config- The channel configuration which may impact this object's behavior.
-
rdHupReceived
void rdHupReceived()
-
allocate
public ByteBuf allocate(ByteBufAllocator alloc)
Description copied from interface:RecvByteBufAllocator.HandleCreates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough not to waste its space.- Specified by:
allocatein interfaceRecvByteBufAllocator.Handle- Overrides:
allocatein classRecvByteBufAllocator.DelegatingHandle
-
continueReading
public boolean continueReading()
Description copied from interface:RecvByteBufAllocator.HandleDetermine if the current read loop should continue.- Specified by:
continueReadingin interfaceRecvByteBufAllocator.Handle- Overrides:
continueReadingin classRecvByteBufAllocator.DelegatingHandle- Returns:
trueif the read loop should continue reading.falseif the read loop is complete.
-
continueReading
public boolean continueReading(UncheckedBooleanSupplier maybeMoreDataSupplier)
Description copied from interface:RecvByteBufAllocator.ExtendedHandleSame asRecvByteBufAllocator.Handle.continueReading()except "more data" is determined by the supplier parameter.- Specified by:
continueReadingin interfaceRecvByteBufAllocator.ExtendedHandle- Parameters:
maybeMoreDataSupplier- A supplier that determines if there maybe more data to read.
-
isFirstRead
public boolean isFirstRead()
-
readComplete
public void readComplete()
Description copied from interface:RecvByteBufAllocator.HandleThe read has completed.- Specified by:
readCompletein interfaceRecvByteBufAllocator.Handle- Overrides:
readCompletein classRecvByteBufAllocator.DelegatingHandle
-
isReadComplete
boolean isReadComplete()
-
lastBytesRead
public void lastBytesRead(int bytes)
Description copied from interface:RecvByteBufAllocator.HandleSet the bytes that have been read for the last read operation. This may be used to increment the number of bytes that have been read.- Specified by:
lastBytesReadin interfaceRecvByteBufAllocator.Handle- Overrides:
lastBytesReadin classRecvByteBufAllocator.DelegatingHandle- Parameters:
bytes- The number of bytes from the previous read operation. This may be negative if an read error occurs. If a negative value is seen it is expected to be return on the next call toRecvByteBufAllocator.Handle.lastBytesRead(). A negative value will signal a termination condition enforced externally to this class and is not required to be enforced inRecvByteBufAllocator.Handle.continueReading().
-
incMessagesRead
public void incMessagesRead(int numMessages)
Description copied from interface:RecvByteBufAllocator.HandleIncrement the number of messages that have been read for the current read loop.- Specified by:
incMessagesReadin interfaceRecvByteBufAllocator.Handle- Overrides:
incMessagesReadin classRecvByteBufAllocator.DelegatingHandle- Parameters:
numMessages- The amount to increment by.
-
-