Easy
UDP delivery and ordering across three datagrams
A client sends three UDP datagrams back-to-back, and the server loop calls recvfrom() three times to receive them. What can the server actually observe?
client_server.cpp
// Client:
sendto(sock, "1", 1, 0, (struct sockaddr*)&dest, sizeof(dest));
sendto(sock, "2", 1, 0, (struct sockaddr*)&dest, sizeof(dest));
sendto(sock, "3", 1, 0, (struct sockaddr*)&dest, sizeof(dest));
// Server:
char buf[16];
for (int i = 0; i < 3; i++) {
recvfrom(sock, buf, sizeof(buf), 0, NULL, NULL);
}2 of 45 in Networking