I've written a simple program to test ipc with a message queue.
I get a new queue id, then fork some other processes. The parent
(server) puts a separate message in the queue for every client (with a
different message type to identify clients).
Clients are supposed to remove their own messages from the queue, then
pack a response and put it back on the queue with a msg type of 1 (to
identify the server).
The server should then process client input and repeat the whole loop
(send msgs to clients, wait for answers, process input...)
The problem is that all the clients hang when trying to get a message
(via msgrcv). ipcs shows that clients have removed their messages from
the queue (byte used and messages to 0), so how could it be that
msgrcv doesn't return?
I know that messages are correctly sent by the server, because
removing msgrcv in clients let me show that the queue is loaded with
the right number of bytes.
Thanks for any hint,