public final class DatagramPacket extends DefaultAddressedEnvelope<ByteBuf,java.net.InetSocketAddress> implements ByteBufHolder
DatagramChannel
to communicate with the remote peer.Constructor and Description |
---|
DatagramPacket(ByteBuf data,
java.net.InetSocketAddress recipient)
Create a new instance with the specified packet
data and recipient address. |
DatagramPacket(ByteBuf data,
java.net.InetSocketAddress recipient,
java.net.InetSocketAddress sender)
Create a new instance with the specified packet
data , recipient address, and sender
address. |
Modifier and Type | Method and Description |
---|---|
DatagramPacket |
copy()
Create a deep copy of this
ByteBufHolder . |
DatagramPacket |
duplicate()
Duplicate the
ByteBufHolder . |
DatagramPacket |
retain()
Increases the reference count by
1 . |
DatagramPacket |
retain(int increment)
Increases the reference count by the specified
increment . |
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, java.net.InetSocketAddress recipient)
data
and recipient
address.public DatagramPacket(ByteBuf data, java.net.InetSocketAddress recipient, java.net.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 retain()
ReferenceCounted
1
.retain
in interface ByteBufHolder
retain
in interface ReferenceCounted
retain
in class DefaultAddressedEnvelope<ByteBuf,java.net.InetSocketAddress>
public DatagramPacket retain(int increment)
ReferenceCounted
increment
.retain
in interface ByteBufHolder
retain
in interface ReferenceCounted
retain
in class DefaultAddressedEnvelope<ByteBuf,java.net.InetSocketAddress>
Copyright © 2008–2018 The Netty Project. All rights reserved.