Wednesday 21 December 2011

Posix message queue help

Posix message queue help

Hi,

I am developing an API which will communicate with a daemon.
I am using POSIX message queues.

The API functions will send a message requesting data to the daemons message queue. The response from the daemon will be sent to another message queue which will be read by the api calling function and the then the api sends a response back.

My problem is that how to read the messages coming from the daemon. Here is example

api function A
{

send message to message daemon
poll message queue

}

api function B
{

send message to message daemon
poll message queue

}


Can the polling of the message queue just waiting for a certain message? api function a is waiting for its response and api function b is waiting for its response but it one function reads all the data then its a problem. What do you think is the best way to handle this?

thanks for your time

No comments:

Post a Comment