Class SegmentedDatagramPacket

  • All Implemented Interfaces:
    io.netty5.channel.AddressedEnvelope<io.netty5.buffer.Buffer,​SocketAddress>, io.netty5.util.Resource<io.netty5.channel.socket.DatagramPacket>, AutoCloseable

    public class SegmentedDatagramPacket
    extends io.netty5.channel.socket.DatagramPacket
    Allows to use GSO if the underlying OS supports it. Before using this you should ensure your system support it.
    • Constructor Detail

      • SegmentedDatagramPacket

        public SegmentedDatagramPacket​(io.netty5.buffer.Buffer message,
                                       int segmentSize,
                                       SocketAddress recipient,
                                       SocketAddress sender)
        Create a new segmented datagram packet. The attached message may be sent in multiple segment-sized network packets.
        Parameters:
        message - The data to send.
        segmentSize - The (positive) segment size.
        recipient - The recipient address.
        sender - The sender address.
      • SegmentedDatagramPacket

        public SegmentedDatagramPacket​(io.netty5.buffer.Buffer message,
                                       int segmentSize,
                                       InetSocketAddress recipient)
        Create a new segmented datagram packet. The attached message may be sent in multiple segment-sized network packets.
        Parameters:
        message - The data to send.
        segmentSize - The (positive) segment size.
        recipient - The recipient address.
    • Method Detail

      • segmentSize

        public int segmentSize()
        Return the size of each segment (the last segment can be smaller).
        Returns:
        size of segments.
      • replace

        public SegmentedDatagramPacket replace​(io.netty5.buffer.Buffer content)
        Overrides:
        replace in class io.netty5.channel.socket.DatagramPacket
      • touch

        public SegmentedDatagramPacket touch​(Object hint)
        Specified by:
        touch in interface io.netty5.util.Resource<io.netty5.channel.socket.DatagramPacket>
        Overrides:
        touch in class io.netty5.channel.socket.DatagramPacket