Consider a server process being contacted by multiple client processes using UNIX socket as the IPC mechanism.
Each client code runs in infinite loop trying to read and write data from/to the socket.
My question: How does a client know that it is not reading data meant to be read by some other process? The server process is writing data to a single socket, right?
For TCP/IP this question doesn’t make sense – a socket would mean a tuple <remote host, remote port, local host, local port, protocol> so processes running off different machines trying to access the server can never read each other’s data.
But for UNIX sockets it’s just a file right? Or am I missing something?
1 Answer