Bill Caroselli <qtps@earthlink.net> wrote:
Two questions about MsgInfo().
First, is there a difference between passing a _msg_info pointer to the
MsgReceive() functions and subsequently calling the MsgInfo() function?
The docs kind of imply that calling MsgInfo() can return more info then
passing the struct pointer. If that is true, what info isn’t available
if only passing the pointer to the MsgReceive() function?
If the client is reply blocked, and has been hit by a signal, and
the server is PPF_SIGCATCH (well, the Neutrino equivalent, forget the
name) the flags in the info of the later MsgInfo() can be checked to
see if that is true. (And there might be other stuff.)
Also, if there an equivlent method for determining the bytes received
in the reply message after a MsgSend()?
No. (The return value is often used for this.)
If not, is it ever possible that the reply is across a network and not
all bytes were actually transferred? {like in the original MsgSend() }
Not in a successful transaction (MsgSend returned success). If MsgSend()
fails due, possibly, to a network outage during the transfer, some of
the bytes in the reply buffer may have been filled in with data, but not
all.
The reason not all might be copied to the receive buffer is buffering,
essentially:
– on send, a certain amount is immediately copied accross the network
to the remote side and buffered there
– on MsgReceive() the locally buffered amount is copied into the
receive buffer, and the server unblocked immediately
– the server can then get the rest, by specifying a buffer to MsgRead()
the network stack need not buffer the data, so any amount can be
copied
Similarly, on reply – the entire reply buffer for the MsgSend() is available,
so the data can be copied in as the networking stack gets it, so io-net
doesn’t have to buffer it, so you will always get the full thing.
-David
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.