All of these examples are adaptations of examples from "Unix Network Programming" by Richard Stevens.