Communicating clients that are connected to the same server
First of all, I'm using Linux. Well, the problem is that I have an average basic server (like the one you can get on the beej tutorial). I see that when the server receives a connection from a client, it uses fork() to generate a new process to handle the client's connection. And that repeats when it receives other client connections. The question is: how can I make those clients, that are in different processes, communicate with each other. Take as an example a chat. Two clients connect to the server, and the server generates a process for each client; but how can the clients exchange information with each other in order to be able to chat?
Well, that's my question, hope I was clear. If there's something you don't understand about my question, please, don't hesitate to ask. Any help will be very appreciated.