You always hear that UDP messages aren't reliable. They tell you to use UDP in situations where it's OK for packets to disappear randomly, or be corrupted, or be duplicated.
What I want to find out is, does that actually happen? In $CURRENT_YEAR?
Let's send a bunch of UDP datagrams and find out.
Experiment | Datagrams sent | Datagrams corrupted | Datagrams that didn't arrive |
---|---|---|---|
LAN between two computers | 58,090,836 | 0 | 0 |
Between South US and Canadian VPS | 111,256 | 0 | 0 |
./UdpSafety server {port}
Example: ./UdpSafety server 3555
./UdpSafety client {server ip}:{port}
Example: ./UdpSafety client 192.168.1.55:3555