Datagram packets are used to implement a connectionless packet
delivery service. Each message is routed from one machine to
another based solely on information contained within that packet.
Multiple packets sent from one machine to another might be routed
differently, and might arrive in any order.
DatagramPacket
public DatagramPacket(byte ibuf[],
int ilength)
Constructs a DatagramPacket for receiving packets of
length ilength.
The length argument must be less than or equal to
ibuf.length.
Parameters:
ibuf - buffer for holding the incoming datagram.
ilength - the number of bytes to read.
DatagramPacket
public DatagramPacket(byte ibuf[],
int ilength,
InetAddress iaddr,
int iport)
Constructs a datagram packet for sending packets of length
ilength to the specified port number on the specified
host. The length argument must be less than or equal
to ibuf.length.