Write the calls. Then break them.
A server and a client talk over TCP. Build each program from the socket calls, run both, and see what the operating system says. Wrong order, wrong error.
Server runs first
Client runs second
Nothing has run yet.
Pick calls, then run.
The server starts first. Calls that wait, like accept and recv, hold that side until the other one lets it go on.
How this works: it is a model of one TCP server and one client on one machine, with the server on port 8080. Every error name and number was checked against real sockets on a real machine, but the game leaves out many things (UDP, several clients, timeouts, partial reads). A close ends the whole program. A server’s send repeats the last thing it received.