In recv()'s man page I found that return value can be zero in such case:
Datagram sockets in various domains (e.g., the UNIX and Internet domains) permit zero-length datagrams. When such a datagram is received, the return value is 0.
When or why should one use zero-length datagrams in UNIX socket intercommunication? What's its purpose?