A simple client/server example ------------------------------ ... with one message sent and recieved. I googled "c client server example" and found https://www.programminglogic.com/ example-of-client-server-program-in-c-using-sockets-and-tcp/ which has the code here ... though I made some modifications, an a few includes, prints, closing things, and changing the names and definitions to be clearer to me. Reading the man pages for these system calls is helpful; see for exampe http://manpages.ubuntu.com/manpages/bionic/man2 . The HOST address should match in the server.c and client.c. If it's set to 127.0.0.1, the "localhost" or "loopback" address, then both processes must be running on this machine. If it's set to this hosts IP address (which I'm just doing explicitly here rather than asking the system for it; "host shannon.marlboro.college" will look it up), then the client and server can be both here or on two different network connected computers. This code compiled fine on my mac (10.14.1 with xcode installed) as well as on shannon.marlboro.college (ubuntu). Running the server on shannon and the client on my mac worked as expected. getting the web page -------------------- $ curl htps://... > example.html compiling it ------------ $ make client cc client.c -o client $ make server cc server.c -o server running it ---------- This can be done on one terminal with the server in the background. $ ./server & [1] 21833 Server: listening on port 7891 ... $ ./client Server: connection established. Server: message sent. Server exiting. Client: connection established. Client: received: "The server says 'Hi there!'" Client exiting. [1]+ Done ./server ==================================================