The files referenced here may be of use in understanding more about programming with sockets. There are two sets of lecture notes from the University of Wisconsin as well as a paper about sockets in the Berkeley Unix operating system. I think the Robert Olsen presentation is the easiest to understand but the Dovrolis  presentation goes into more depth while the Besaw paper has a lot more details.

I would not count on these presentations and papers to be correct in every detail for the lab machines that we will be using. These interfaces, while quite well-standardized, do show some variability among different operating systems. If you find something that doesn't quite match up try the manual (man) pages on the machine you are using. I'd be particularly unsurprised by differences in the paths to the .h files needed to use these facilities.

The first link for each file is to a postscript file on the author's web site. This is guaranteed to get you the latest copy. But for convenience there is also a link to a local PDF version captured the week of January 21, 2001.

Robert Olsen, "The BSD UNIX Socket Interface", Lecture Notes. Local PDF file

Lawrence Besaw, "BSD Socket Reference: Berkeley Unix System Calls and Interprocess Communications" (revised by Marvin Solomon). Local PDF file

Constantinos Dovrolis, "BSD Sockets API", Lecture Notes. Local PDF file