This content has been marked as final. Show 1 reply
TCP guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent. UDP on the other hand is an unreliable protocol. There is no guarantee that the datagram will be delivered to the destination host (although loss on a LAN is probably close to 0). The datagrams can also be delivered in an incorrect order. You can also receive the same packet twice. If you for some reason decide to use UDP, your application must be prepared to handle all those situations: missing datagram, duplicate datagram or datagram in the incorrect order. So unless we're talking broadcasting of video, audio etc where it's more important that the packet arrives on time then at all, you're better off using TCP.