It seems there\'s atleast 3 different local/unix socket types (AF_UNIX
) , SOCK_STREAM
, SOCK_DGRAM
and SOCK_SEQPACKET
.
socket(2) linux-provided manpage: “DGRAM: datagrams (connectionless, unreliable messages), SEQPACKET: sequenced, reliable, [two-way] connection-based data transmission path for datagrams". Significant difference.
unix(7) linux-provided manpage says: “SOCK_DGRAM, for a datagram-oriented socket that preserves message boundaries [but not necessarily order] [...] SOCK_SEQPACKET, for a connection-oriented socket that preserves message boundaries and delivers messages in the order that they were sent.”
The standard permits that you get reordered packets with SOCK_DGRAM. (In other words, if an OS hands them to you in order, that is an implementation-specific feature. Or just pure timing luck.)
There is flow control in the af_file/af_unix implementation in Linux, but that does not need to correlate with standard specified behavior at all.