Package io.netty.handler.codec.quic
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.
@FunctionalInterface public interface SegmentedDatagramPacketAllocator
Used to allocate datagram packets that use UDP_SEGMENT (GSO).
-
-
Field Summary
Fields Modifier and Type Field Description static SegmentedDatagramPacketAllocatorNONESegmentedDatagramPacketAllocatorwhich should be used if no UDP_SEGMENT is supported and used.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intmaxNumSegments()The maximum number of segments to use per packet.io.netty.channel.socket.DatagramPacketnewPacket(io.netty.buffer.ByteBuf buffer, int segmentSize, InetSocketAddress remoteAddress)Return a new segmentedDatagramPacket.
-
-
-
Field Detail
-
NONE
static final SegmentedDatagramPacketAllocator NONE
SegmentedDatagramPacketAllocatorwhich should be used if no UDP_SEGMENT is supported and used.
-
-
Method Detail
-
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
io.netty.channel.socket.DatagramPacket newPacket(io.netty.buffer.ByteBuf buffer, int segmentSize, InetSocketAddress remoteAddress)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.
-
-