The Windows documentation for socket says the address family is the first argument; the man page on my linux box says it should be a protocol family. The Linux version looks a little more correct from the platform point of view - agnostic - theoretically, a socket has a protocol family, and addresses have address families, and two must be compatible.
However, in practice, the PF_ and AF_ for embedded protocols have the same values (both on Linux and Windows). I imagine a similar story for most operating systems, since all common protocol families have the same address family. (You would assume that IP will have two, but no. There are separate protocol families for IPv4 and IPv6.) This (along with the relatively weak type C) allows them to be used interchangeably.
Please note that there is no guarantee that this applies to all operating systems, or to protocols supported by a third-party driver, etc. In these cases, you should read the documentation for your specific platform.
As far as the "NS addresses" are concerned, as far as I can tell, they are part of the prehistoric Xerox Network Systems Protocol (a family sorting protocol such as TCP / IP, but excellent and incompatible and not used by modern PCs). You will not see them in use if you do not work with archaic systems; why this is preserved as an example, outside of me.
cHao
source share