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).
    • Method Detail

      • maxNumSegments

        default int maxNumSegments()
        The maximum number of segments to use per packet. By default this is 10 but 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 segmented DatagramPacket.
        Parameters:
        buffer - the ByteBuf that is used as content.
        segmentSize - the size of each segment.
        remoteAddress - the remote address to send to.
        Returns:
        the packet.