Guardian Programmer's Guide

Table Of Contents
Using the File System
Guardian Programmer’s Guide 421922-014
2 - 25
.
.
CALL REPLYX(BUFFER,COUNT);
The call to REPLYX by the server satisfies the WRITEREADX call. That is, whatever
REPLYX returns in its BUFFER is what WRITEREADX reads.
Note that the sixth parameter, the receive depth, is specified in the FILE_OPEN_ call in
the server. Here, the receive depth is specified as 1 to enable the READUPDATEX
procedure to process one message at a time. The receive depth is discussed in detail
in Section 6, Communicating With Processes, along with other interprocess
communication issues.
In one-way communication, the server passes no information in the response to the
requester. In this case, the requester can issue the request using the WRITEX
procedure instead of WRITEREADX. Because the server does not send any
information in the reply, it can read the message from $RECEIVE using the READX
procedure. The reply to the requester is made when the READX finishes, allowing the
WRITEX in the requester to finish. If there is no message in $RECEIVE, the READX
call waits until a message arrives (unless the “nowait” option is specified; see
Section 4, Using Nowait Input/Output).
$REQ $SER1
NAME ':=' "$SER1"; NAME ':=' "$RECEIVE";
LEN := 5; LEN := 8;
ERROR := FILE_OPEN_( ERROR := FILE_OPEN_(
NAME:LEN, NAME:LEN,
FNUM, FNUM,
!access!, !access!,
!exclusion!, !exclusion!,
!nowait^depth!, !nowait^depth!,
1); 1);
. .
. .
. .
BUFFER ':=' "MESSAGE...";
CALL WRITEX(FNUM,BUFFER, CALL READX(FNUM,BUFFER,
WCOUNT); RCOUNT);
. .
. .
There is actually a third way of communicating with another process (sometimes called
“one-and-a-half-way communication”) that has elements of one-way communication
and two-way communication. Here, the requester sends a message to the server
using the WRITE[X] procedure (not expecting return data). If the server reads the
message using the READUPDATE[X] procedure, the WRITE[X] does not terminate
until the server responds by calling REPLY[X]. The WRITE[X] procedure cannot read
data, but it does return the file-system error number sent in the reply.