2 ms·
TCP is suitable for "flat" static content, which you only retrieve at punctual intervals, and is relatively large. A good example is a file which won't change f
by jokoon 11y ago
TCP is suitable for "flat" static content, which you only retrieve at punctual intervals, and is relatively large. A good example is a file which won't change for the next 5 min, and you know that you want that exact file BUT you are ready to wait until it loads perfectly.
UDP is for real time, continuous data, when you can't wait for your hardware to check for packet consistency.
A good example is paper mail versus a telephone call. The paper mail will land, but you don't care if your phone line cuts for 1 second. You just wait for the other guy to check if he can hear you
UDP is really much better when you want to have performance, especially when it comes to responsiveness and latency, but can afford to discard packets if they're not reliable.
I think it boils down to people not realizing how hard it is to transmit data over long distances, and that the protocol don't consider that data transmission is 100% good, because it never is. You can have a lot of interference in your network, but TCP will always manage to land those packets.