|
Re: MsgSendvs Returning 34
|
08/08/2024 1:45 PM
post122594
|
Re: MsgSendvs Returning 34
This is basic message passing in QNX, which I sure hope is covered by the documentation.
Client:
rc = MsgSend(coid, &msg, sizeof(msg), &reply_buf, sizeof(reply_buf));
Server:
rcvid = MsgReceive(chid, &buf, sizeof(buf), &info);
// Do work
MsgReply(rcvid, status, &reply, sizeof(reply));
Client now returns with the value of "status" in "rc", a copy of the server's reply in "reply_buf".
An error is returned if one of the following occurs:
1. MsgSend() fails to send the message to the server
2. The server indicates an error by using MsgError() instead of MsgReply()
3. The server fails on its MsgReply() call
--Elad
|
|
|
|
Re: MsgSendvs Returning 34
|
08/08/2024 2:17 PM
post122595
|
Re: MsgSendvs Returning 34
Walter, as Elad is pointing out, the server can send two things back when replying.
MsgReply(rcvid, status, &reply_msg, sizeof(reply_msg)
In the above, that's the status and the reply_msg. The status sets the return value for MsgSendvs(), provided the MsgSendvs() doesn't fail.
So for...
rc = MsgSendvs(...)
rc seems to be 34 in your case. i.e., the server is doing something like...
MsgReply(rcvid, 34, &reply_msg, sizeof(reply_msg)
To find out what the server is expected to send back, what 34 represents, you need to check the server code or check with whomever wrote the server code or often there's a common header file that both the client and server include that describes the message protocol.
We recommend that the server use a value >= 0 for the status, negative values can be confusing for the client.
|
|
|