Mario Charest
09/30/2009 11:49 AM
post39097
|
Put the size in the message itself.
> -----Original Message-----
> From: Josh Schmiedlin [mailto:community-noreply@qnx.com]
> Sent: Wednesday, September 30, 2009 11:49 AM
> To: momentics-community
> Subject: Re: Reply size?
>
> What about when you use a custom message. In other words I'm using
> MsgSend directly with a user defined message. There are cases where
> many clients send messages off to the server and these msgs are replied
> to until something changes at the server. The reply is used to pass
> back information about what has changed (note: the information varies
> in size considerably depending on what is being asked for). I would
> like to know exactly how much was passed back for efficiency reasons as
> I need to perform memcpy's of the data and I don't want to always copy
> the maximum amount.
>
> Thanks,
>
> Josh
>
>
>
> _______________________________________________
>
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post39096
>
|
|
|
Xiaodan Tang(deleted)
09/30/2009 12:44 PM
post39106
|
When you reply:
MsgReply(rcvid, status, buffer, len);
The "status" would be the return value of MsgSend() at the other end. So
you can:
MsgReply(rcvid, len, buffer, len);
This way, by check the return value of MsgSend(), the sender would know
exactly how much bytes you replyed. (That's how read() function is
implemented)
On the side note, if you wish to fail the request, then:
MsgError(rcvid, err)
Would result MsgSend() return -1, with errno being set to "err".
-xtang
> -----Original Message-----
> From: Josh Schmiedlin [mailto:community-noreply@qnx.com]
> Sent: September 30, 2009 11:49 AM
> To: momentics-community
> Subject: Re: Reply size?
>
> What about when you use a custom message. In other words I'm using
> MsgSend directly with a user defined message. There are cases where
many
> clients send messages off to the server and these msgs are replied to
> until something changes at the server. The reply is used to pass back
> information about what has changed (note: the information varies in
size
> considerably depending on what is being asked for). I would like to
know
> exactly how much was passed back for efficiency reasons as I need to
> perform memcpy's of the data and I don't want to always copy the
maximum
> amount.
>
> Thanks,
>
> Josh
>
>
>
> _______________________________________________
>
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post39096
|
|
|