I've been learning about Linux socket programming recently, mostly from this site.
The site says that using the domain/type combination PF_LOCAL
/SOCK_DGRAM
...
Provides datagram services within the local host. Note that this service is connectionless, but reliable, with the possible exception that packets might be lost if kernel buffers should become exhausted.
My question, then, is why does socketpair(int domain, int type, int protocol, int sv[2])
allow this combination, when according to its man page...
The socketpair() call creates an unnamed pair of connected sockets in the specified domain, of the specified type...
Isn't there a contradiction here?
I thought SOCK_DGRAM
in the PF_LOCAL
and PF_INET
domains implied UDP, which is a connectionless protocol, so I can't reconcile the seeming conflict with socketpair()
's claim to create connected sockets.