Top Description Constructors Methods
io.netty5.channel.socket

public Class DatagramPacket

extends BufferAddressedEnvelope<SocketAddress, DatagramPacket>
Class Inheritance
Imports
io.netty5.buffer.Buffer, io.netty5.channel.BufferAddressedEnvelope, java.net.SocketAddress

The message container that is used for DatagramChannel to communicate with the remote peer.

Constructor Summary

AccessConstructor and Description
public
DatagramPacket(Buffer message, SocketAddress recipient, SocketAddress sender)

Create a new instance with the specified packet data, recipient address, and sender address.

public
DatagramPacket(Buffer message, SocketAddress recipient)

Create a new instance with the specified packet data and recipient address.

Method Summary

Modifier and TypeMethod and Description
public DatagramPacket
replace(Buffer
The contents of the returned addressed envelope instance.
content
)

Implements abstract io.netty5.channel.BufferAddressedEnvelope.replace.

Create a new addressed envelope instance, that has the same recipient and sender as this one, but the given content.
public DatagramPacket
touch(Object
An optional hint about this access and its context. May be null.
hint
)

Overrides default io.netty5.util.Resource.touch.

Record the current access location for debugging purposes.
Inherited from io.netty5.channel.BufferAddressedEnvelope:
closeisAccessiblesend

Constructor Detail

DatagramPacketback to summary
public DatagramPacket(Buffer message, SocketAddress recipient, SocketAddress sender)

Create a new instance with the specified packet data, recipient address, and sender address.

DatagramPacketback to summary
public DatagramPacket(Buffer message, SocketAddress recipient)

Create a new instance with the specified packet data and recipient address.

Method Detail

replaceback to summary
public DatagramPacket replace(Buffer content)

Implements abstract io.netty5.channel.BufferAddressedEnvelope.replace.

Doc from io.netty5.channel.BufferAddressedEnvelope.replace.

Create a new addressed envelope instance, that has the same recipient and sender as this one, but the given content.

Parameters
content:Buffer

The contents of the returned addressed envelope instance.

Returns:DatagramPacket

An addressed envelope instance that has the same recipient and sender as this one, but the given content.

Annotations
@Override
touchback to summary
public DatagramPacket touch(Object hint)

Overrides default io.netty5.util.Resource.touch.

Doc from io.netty5.util.Resource.touch.

Record 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:Object

An optional hint about this access and its context. May be null.

Returns:DatagramPacket

This resource instance.

Annotations
@Override