public class DatagramPacket extends DefaultAddressedEnvelope<ByteBuf,InetSocketAddress> implements ByteBufHolder
DatagramChannel to communicate with the remote peer.| Constructor and Description |
|---|
DatagramPacket(ByteBuf data,
InetSocketAddress recipient)
Create a new instance with the specified packet
data and recipient address. |
DatagramPacket(ByteBuf data,
InetSocketAddress recipient,
InetSocketAddress sender)
Create a new instance with the specified packet
data, recipient address, and sender
address. |
| Modifier and Type | Method and Description |
|---|---|
DatagramPacket |
copy()
Creates a deep copy of this
ByteBufHolder. |
DatagramPacket |
duplicate()
Duplicates this
ByteBufHolder. |
DatagramPacket |
replace(ByteBuf content)
Returns a new
ByteBufHolder which contains the specified content. |
DatagramPacket |
retain()
Increases the reference count by
1. |
DatagramPacket |
retain(int increment)
Increases the reference count by the specified
increment. |
DatagramPacket |
retainedDuplicate()
Duplicates this
ByteBufHolder. |
DatagramPacket |
touch()
Records the current access location of this object for debugging purposes.
|
DatagramPacket |
touch(Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
content, recipient, refCnt, release, release, sender, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontentrefCnt, release, releasepublic DatagramPacket(ByteBuf data, InetSocketAddress recipient)
data and recipient address.public DatagramPacket(ByteBuf data, InetSocketAddress recipient, InetSocketAddress sender)
data, recipient address, and sender
address.public DatagramPacket copy()
ByteBufHolderByteBufHolder.copy in interface ByteBufHolderpublic DatagramPacket duplicate()
ByteBufHolderByteBufHolder. Be aware that this will not automatically call ByteBufHolder.retain().duplicate in interface ByteBufHolderpublic DatagramPacket retainedDuplicate()
ByteBufHolderByteBufHolder. This method returns a retained duplicate unlike ByteBufHolder.duplicate().retainedDuplicate in interface ByteBufHolderByteBuf.retainedDuplicate()public DatagramPacket replace(ByteBuf content)
ByteBufHolderByteBufHolder which contains the specified content.replace in interface ByteBufHolderpublic DatagramPacket retain()
ReferenceCounted1.retain in interface ByteBufHolderretain in interface AddressedEnvelope<ByteBuf,InetSocketAddress>retain in interface ReferenceCountedretain in class DefaultAddressedEnvelope<ByteBuf,InetSocketAddress>public DatagramPacket retain(int increment)
ReferenceCountedincrement.retain in interface ByteBufHolderretain in interface AddressedEnvelope<ByteBuf,InetSocketAddress>retain in interface ReferenceCountedretain in class DefaultAddressedEnvelope<ByteBuf,InetSocketAddress>public DatagramPacket touch()
ReferenceCountedResourceLeakDetector. This method is a shortcut to touch(null).touch in interface ByteBufHoldertouch in interface AddressedEnvelope<ByteBuf,InetSocketAddress>touch in interface ReferenceCountedtouch in class DefaultAddressedEnvelope<ByteBuf,InetSocketAddress>public DatagramPacket touch(Object hint)
ReferenceCountedResourceLeakDetector.touch in interface ByteBufHoldertouch in interface AddressedEnvelope<ByteBuf,InetSocketAddress>touch in interface ReferenceCountedtouch in class DefaultAddressedEnvelope<ByteBuf,InetSocketAddress>Copyright © 2008–2025 The Netty Project. All rights reserved.