asynchmsg_* and name_*

Can a channel returned by name_attach and a connection returned by name_open
be used for asynchronous messaging (asyncmsg_put, asyncmsg_get)?
If not, what is the recommended method for a client to determine a server’s
node, pid and channel?

Dominic Herity <dominic.herity@redplain.com> wrote:

Can a channel returned by name_attach and a connection returned by name_open
be used for asynchronous messaging (asyncmsg_put, asyncmsg_get)?
If not, what is the recommended method for a client to determine a server’s
node, pid and channel?

No, it must use a different channel.

There is no name location message for the asyncmsg_put/get communication.

If you have 6.3.0 SP2 (or later), then example 6 in the Async Messaging
tech note gives an example of using name_attach()/name_open() and a
query message for the async client to get the server’s async channel.
The server gets pulses when it needs to handle asyncmsg_get()s, or regular
messages. The server could, of course, have one thread for sync messages,
and one thread for asynch messages instead.

(If you don’t have at least 6.3.0 SP2, then I’d advise updating before
using the async messages, as they tended to crash the kernel in earlier
versions.)

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com