messages of unknown size

Hi,

When we exchange messages between client and server, when the
MsgReceive() unblocks it’s possible, from the server side to call
MsgRead() to read a header to know the size of the message and then call
again MsgRead() to read the message itself.
It seems not possible to do the same on the client side when MsgSend()
unblocks.
Right?

Thanks,
Alain.

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:

Hi,

When we exchange messages between client and server, when the
MsgReceive() unblocks it’s possible, from the server side to call
MsgRead() to read a header to know the size of the message and then call
again MsgRead() to read the message itself.
It seems not possible to do the same on the client side when MsgSend()
unblocks.
Right?

Correct. When the MsgSend() unblocks, all the message must be in the
reply-buffer, and the reply-buffer must have been large enough to hold
that message. (The server can go and read more, because the client is
known to be in a blocked state, so won’t be modifying the contents of
the buffer, the server may not be in a blocked state, so the status of
its reply data is unknown.)

-David

QNX Training Services
dagibbs@qnx.com