Guardian Programmer's Guide

Table Of Contents
Communicating With Processes
Guardian Programmer’s Guide 421922-014
6 - 28
Receiving System Messages
Whether you choose to receive system messages affects the time at which the
corresponding open in the requester finishes:
If the server opens $RECEIVE without requesting system messages, the
requester’s open finishes as soon as the server has opened $RECEIVE.
If the server opens $RECEIVE to request system messages and to enable two-
way communication (receive-depth parameter set to a value greater than zero),
the requesters open finishes when the server replies to the Open message.
If the server opens $RECEIVE to request system messages but does not enable
two-way communication (receive-depth parameter set to zero), the requester’s
open finishes when the server reads the Open message.
Receiving C-Series or D-Series System Messages
The options parameter also determines whether your process will read D-series
system messages or C-series system messages. For example, message -103 is the
D-series Open message, and message -30 is the equivalent C-series Open message.
By default, you receive only the D-series messages. However, you can receive the
C-series messages instead by setting bit 14 of the options parameter to 1.
The remainder of this section assumes D-series messages.
Reading System Messages
When you receive a system message from $RECEIVE, the READUPDATE[X] or
READ[X] procedure returns a warning condition (CCG). Currently, a system message
is the only reason why the READUPDATE[X] or READ[X] procedure returns with CCG.
However, we recommend testing for error number 6 (system message received) in
case other reasons for returning CCG are added in the future.
CALL READUPDATEX(RECV^NUM,
SBUFFER,
RCOUNT);
IF <> THEN
BEGIN
CALL FILE_GETINFO_(RECV^NUM,
ERROR);
IF ERROR = 6 THEN
BEGIN
!Process the system message
.
.
END;
END;
The first word in the buffer returned by the read operation contains the system
message number. Your program should then respond according to the system
message number.