The most significant characteristics of datagram sockets follow:
There is no connection setup affected by the UDP protocol layer. No data is exchanged between sending and receiving UDP protocol layers until your application issues its first send call.
If your UDP server program has not been started or it resides on a host that cannot be reached from your client host, your client UDP application can wait forever to receive a reply to the datagram it sent to a UDP server. You have to implement timeout logic in your client UDP program to recognize this situation.
The implicit significance of this fact is that a datagram sent from one UDP program to another might never arrive. Neither the sending program nor the target program ever learns from the UDP protocol layer that such a condition exists.
If your UDP application must be reliable, you must add reliability code to your UDP client and server programs. Such code must include the ability to detect missing datagrams, datagrams arriving out of sequence, duplicate datagrams, and corrupt datagrams.
You can use TCP protocols instead of UDP protocols if your application must be reliable.