This class represents a datagram packet.
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. Packet delivery is not guaranteed.
Unless otherwise specified, passing a null
argument causes a NullPointerException
to be thrown.
Methods and constructors of DatagramPacket
accept parameters of type SocketAddress
. DatagramPacket
supports InetSocketAddress
, and may support additional SocketAddress
sub-types.