jinma <firstname.lastname@example.org> wrote:
how can we set up the resource manager to receive MsgSend() and/or
MsgSendPulse() from a client?
And How can the client send these messages to the resource manager if
it doesn’t know the pid and chid of the resource manager?
I know I can open the resource manager and get a fd to call POSIX read
and write calls …etc, so are we limited to doing POSIX calls to
Once you have done an open() on the resource manager, that fd can be
used as (is) a coid, and can be passed to MsgSend(). [In fact, what
write() basically does is create a header, setup a two part IOV, then
call MsgSendv(fd, iov, 2, NULL, 0 ).]
There are two main ways of handling MsgSend() messages in a resource
IO_MSG – setup a header with a message type of IO_MSG and register
a msg callback (registered just the way you would a read or write
callback). The library will do the ocb lookup, lock the attribute
structure and all the normal stuff for an IO message. This is good
if your messages are going to be associated with the transaction
sequence (fd) or device that was opened.
message_attach(). Message type must be outside the IO range
we used (IO_MIN to IO_MAX). The ocb is NOT looked up, the
attribute structure is not found or locked. This could best be
thought of a message to the server itself, not associated with
any particular device.
QNX Training Services