Socket programming and networking examples in Java.
TCP & UDP work differently. There exist no connection b/w server and client, while using UDP. Data might be sent by a client to the server which may or may not get that data. Client never knows whether data was reached or not at the other end. Same thing happens with that data which is sent other way to client from server.
Data delivery is not guaranteed hence this means that UDP holds less protocol overhead.
Many situations are present where connectionless UDP models are