- java.lang.Object
-
- io.netty5.channel.DefaultAddressedEnvelope<Buffer,A>
-
- io.netty5.channel.BufferAddressedEnvelope<SocketAddress,DatagramPacket>
-
- io.netty5.channel.socket.DatagramPacket
-
- All Implemented Interfaces:
AddressedEnvelope<Buffer,SocketAddress>,Resource<DatagramPacket>,AutoCloseable
- Direct Known Subclasses:
SegmentedDatagramPacket
public class DatagramPacket extends BufferAddressedEnvelope<SocketAddress,DatagramPacket>
The message container that is used forDatagramChannelto communicate with the remote peer.
-
-
Constructor Summary
Constructors Constructor Description DatagramPacket(Buffer message, SocketAddress recipient)Create a new instance with the specified packetdataandrecipientaddress.DatagramPacket(Buffer message, SocketAddress recipient, SocketAddress sender)Create a new instance with the specified packetdata,recipientaddress, andsenderaddress.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatagramPacketreplace(Buffer content)Create a new addressed envelope instance, that has the same recipient and sender as this one, but the given content.DatagramPackettouch(Object hint)Record the current access location for debugging purposes.-
Methods inherited from class io.netty5.channel.BufferAddressedEnvelope
close, isAccessible, send
-
Methods inherited from class io.netty5.channel.DefaultAddressedEnvelope
content, recipient, sender, toString
-
-
-
-
Constructor Detail
-
DatagramPacket
public DatagramPacket(Buffer message, SocketAddress recipient, SocketAddress sender)
Create a new instance with the specified packetdata,recipientaddress, andsenderaddress.
-
DatagramPacket
public DatagramPacket(Buffer message, SocketAddress recipient)
Create a new instance with the specified packetdataandrecipientaddress.
-
-
Method Detail
-
replace
public DatagramPacket replace(Buffer content)
Description copied from class:BufferAddressedEnvelopeCreate a new addressed envelope instance, that has the same recipient and sender as this one, but the given content.- Specified by:
replacein classBufferAddressedEnvelope<SocketAddress,DatagramPacket>- Parameters:
content- The contents of the returned addressed envelope instance.- Returns:
- An addressed envelope instance that has the same recipient and sender as this one, but the given content.
-
touch
public DatagramPacket touch(Object hint)
Description copied from interface:ResourceRecord the current access location for debugging purposes. This information may be included if the resource throws a life-cycle related exception, or if it leaks. If this resource has already been closed, then this method has no effect.- Parameters:
hint- An optional hint about this access and its context. May benull.- Returns:
- This resource instance.
-
-