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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
content
refCnt, release, release
public 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()
ByteBufHolder
ByteBufHolder
.copy
in interface ByteBufHolder
public DatagramPacket duplicate()
ByteBufHolder
ByteBufHolder
. Be aware that this will not automatically call ByteBufHolder.retain()
.duplicate
in interface ByteBufHolder
public DatagramPacket retainedDuplicate()
ByteBufHolder
ByteBufHolder
. This method returns a retained duplicate unlike ByteBufHolder.duplicate()
.retainedDuplicate
in interface ByteBufHolder
ByteBuf.retainedDuplicate()
public DatagramPacket replace(ByteBuf content)
ByteBufHolder
ByteBufHolder
which contains the specified content
.replace
in interface ByteBufHolder
public DatagramPacket retain()
ReferenceCounted
1
.retain
in interface ByteBufHolder
retain
in interface AddressedEnvelope<ByteBuf,InetSocketAddress>
retain
in interface ReferenceCounted
retain
in class DefaultAddressedEnvelope<ByteBuf,InetSocketAddress>
public DatagramPacket retain(int increment)
ReferenceCounted
increment
.retain
in interface ByteBufHolder
retain
in interface AddressedEnvelope<ByteBuf,InetSocketAddress>
retain
in interface ReferenceCounted
retain
in class DefaultAddressedEnvelope<ByteBuf,InetSocketAddress>
public DatagramPacket touch()
ReferenceCounted
ResourceLeakDetector
. This method is a shortcut to touch(null)
.touch
in interface ByteBufHolder
touch
in interface AddressedEnvelope<ByteBuf,InetSocketAddress>
touch
in interface ReferenceCounted
touch
in class DefaultAddressedEnvelope<ByteBuf,InetSocketAddress>
public DatagramPacket touch(Object hint)
ReferenceCounted
ResourceLeakDetector
.touch
in interface ByteBufHolder
touch
in interface AddressedEnvelope<ByteBuf,InetSocketAddress>
touch
in interface ReferenceCounted
touch
in class DefaultAddressedEnvelope<ByteBuf,InetSocketAddress>
Copyright © 2008–2024 The Netty Project. All rights reserved.