You already know that choosing a domain value for the socket(2)
or socketpair(2)
function chooses a protocol family to be used. For example, you know that
PF_LOCAL
(which is the same as PF_UNIX) indicates that a local UNIX socket protocol family is being specified.PF_INET
indicates that the Internet family of protocols is used.
Consequently, you now have to learn about only two more input arguments.
The socket type argument in the socket(2)
and socketpair(2)
function calls indicates how a socket will interface with your program. But this is not the whole story, as this parameter also has implications for the protocol that is selected. (You'll understand this better as you progress through this chapter.)