As the title says I'm trying to create a C++ program in linux (Ubuntu) which communicates using the msgget function. This program creates multiple processes using the fork() function and I want each process to be able to communicate with each other via message queues.
The problem I have is that I don't know how to pass messages using only one msgget so I don't have to create one with different key for every process. Is there a way where I can for example do a msgsnd with and specific ID to the message queue so only another process with adds this ID in msgrcv can receive only this message and leave the rest in the message queue?
The only way I've manage to communicate between the process is making a different msgget for each process using a different key, but I'd prefer if there was a way where I can do the same with only one msgget.