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 Details

  • Method Details

    • 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

      DatagramPacket newPacket(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.