Guardian Programmer's Guide

Table Of Contents
Communicating With Processes
Guardian Programmer’s Guide 421922-014
6 - 21
Replying to Messages
ERROR);
IF <> THEN ...
Getting the Message Tag
The message tag identifies a message and is used when the recipient process may
have to process multiple messages. The tag enables the recipient process to send the
reply to the correct process, as described earlier in this section.
The message tag is returned by the FILE_GETRECEIVEINFO_ procedure in word 2:
STRUCT .INFORMATION(ZSYS^DDL^RECEIVEINFORMATION^DEF);
.
.
ERROR := FILE_GETRECEIVEINFO_(INFORMATION);
IF ERROR <> 0 THEN ...;
.
.
MESSAGE^TAG := INFORMATION.Z^MESSAGETAG;
CALL REPLY(BUFFER,
WCOUNT,
!count^written!,
MESSAGE^TAG);
Replying to Messages
When replying to messages that were concurrently processed, you need to include the
message tag as a parameter to the REPLY[X] procedure to ensure that the reply is
sent to the correct process. The following example replies to the three messages
received in the example under Reading Messages for Concurrent Processing, earlier in
this subsection:
CALL REPLYX(SBUFFER0,
WCOUNT,
COUNT^WRITTEN,
TAG0);
IF <> THEN ...;
CALL REPLYX(SBUFFER1,
WCOUNT,
COUNT^WRITTEN,
TAG2);
IF <> THEN ...;
CALL REPLYX(BUFFER2,
WCOUNT,
COUNT^WRITTEN,
TAG1);
IF <> THEN ...;
Note that the order of replying is different from the order of receiving.