Socket programming and networking examples in Java.
Implementation of UDP has been divided into 2 classes which are: DatagramSocket & DatagramPacket. Data is received by the DatagramSocket through bound port and is placed in DatagramPacket. Packet contains all the required information that one may need to know regarding datagram. Connection concepts donít exist is UDP and hence it just knows regarding single datagrams. Listen at the socket and obtain DatagramPacket.
Datagramís data size is 65.536 bytes(minus 8 bytes) for header.