Interface SegmentedDatagramPacketAllocator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Used to allocate datagram packets that use UDP_SEGMENT (GSO).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SegmentedDatagramPacketAllocatorSegmentedDatagramPacketAllocatorwhich should be used if no UDP_SEGMENT is supported and used. -
Method Summary
Modifier and TypeMethodDescriptiondefault intThe maximum number of segments to use per packet.newPacket(ByteBuf buffer, int segmentSize, InetSocketAddress remoteAddress) Return a new segmentedDatagramPacket.
-
Field Details
-
NONE
SegmentedDatagramPacketAllocatorwhich should be used if no UDP_SEGMENT is supported and used.
-
-
Method Details
-
maxNumSegments
default int maxNumSegments()The maximum number of segments to use per packet. By default this is10but this may be overridden by the implementation of the interface.- Returns:
- the segments.
-
newPacket
Return a new segmentedDatagramPacket.- Parameters:
buffer- theByteBufthat is used as content.segmentSize- the size of each segment.remoteAddress- the remote address to send to.- Returns:
- the packet.
-