Package io.activej.net.socket.udp
Class UdpPacket
java.lang.Object
io.activej.net.socket.udp.UdpPacket
This class represents a UDP packet.
Each message is routed from one machine to another based solely on information contained within that packet
-
Method Summary
Modifier and TypeMethodDescriptiongetBuf()Returns the data buffer to send or which was receivedReturns the address to which the packet should be sent or from which it was received.static UdpPacketof(ByteBuf buf, InetSocketAddress inetSocketAddress) Creates a new instance of UDP packetvoidrecycle()Recycles data buffer.
-
Method Details
-
of
Creates a new instance of UDP packet- Parameters:
buf- the data buffer to send or which was receivedinetSocketAddress- the address to which the packet should be sent or from which it was received
-
getBuf
Returns the data buffer to send or which was received -
getSocketAddress
Returns the address to which the packet should be sent or from which it was received. -
recycle
public void recycle()Recycles data buffer. You should do it after use.
-