I am currently learning about IPC and Unix domain sockets. I was wondering what happens with messages that are being sent over a Unix socket while the receiving end is not reading from the socket? Do they get sent regardless whether someone is reading or do they stay in some sort of queue waiting for a reader
Based on my research (Linux), in the case of datagram (message-oriented) Unix socket:
bind()
on the socket, the sender will fail to perform sendto()
;bind()
on the socket and does not keep on doing recvfrom()
, the sender will enqueue a batch of messages up to some limit and stall;recvfrom()
, the sender will resume.See also: sysctl net.unix.max_dgram_qlen
(for queue size).