Hello I am working on a cli/server project, where when a client connects to the server, the server spawns a new thread to handle the client. So for each client a new thread is spawned.

This is all fine but I need to be able to communicate between the main server and the threads that are spawned by it. I also want to be able to communicate between clients via the server.

So here are examples to illustrate:

Cli A->Server->thread A
Cli B->Server->thread B
Cli C->Server->thread C

so now I will need to have threadA directly communicate with Server thread for reporting purposes.

I also would like to have communication between clients for example:
Cli A->Cli C
Now I probably need to setup a connection similar to this:
Cli A->thread A->Server->thread C->Cli C

I know I'll have to use IPC for this but I am not sure which method is best since this is new subject for me.
If anyone can give me ideas on this I would appreciate it.