What are sockets? (12.5)
Sockets are an extension of pipes, with the advantages that the processes don’t need to be related, or even on the same machine
A socket is like the end point of a pipe -- in fact, the UNIX kernel implements pipes as a pair of sockets
Two (or more) sockets must be connected before they can be used to transfer data
Two main categories of socket types … we’ll talk about both:
- the UNIX domain: both processes on same machine
- the INET domain: processes on different machines
Three main types of sockets: SOCK_STREAM, SOCK_DGRAM, and SOCK_RAW … we’ll only talk about SOCK_STREAM