After a socket is created with the socket/3 predicate, one of the processes, the server, gives it a name and waits for a connection. The other process uses the same name when connecting to the former process. After the connection is established, both processes can read and write on the socket and so the difference between the server and the client disappears:
server: [eclipse 10]: socket(unix, stream, s), bind(s, '/tmp/sock'). yes. [eclipse 11]: listen(s, 1), accept(s, _, news). <blocks waiting for a connection> client: [eclipse 26]: socket(unix, stream, s), connect(s, '/tmp/sock'). yes. [eclipse 27]: printf(s, "%w. %b", message(client)), read(s, Msg). server: [eclipse 12]: read(news, Msg), printf(news, "%w. %b", message(server)). Msg = message(client) yes. client: Msg = message(server) yes.