User guide

Writing ENFORM Servers
ENFORM Servers
7–4 058058 Tandem Computers Incorporated
The preceding dialogue takes place within an ENFORM server session. A session is
one query execution or the period of time an ENFORM server is held open by a server
query processor. (The ENFORM server can be designated as a file to be held open
when the server query processor is started.)
An ENFORM server that is held open by a server query processor can be read many
times for one request or many requests. An ENFORM server opened by either a
dedicated or server query processor to process one query can also be read many times.
In other words, once an ENFORM server is opened the data must be able to be read
multiple times whether for one query or many queries.
Interprocess
Communication
Communication between the query processor and an ENFORM server is based on a
requester/server dialogue that enables a single round-trip message transfer. A
message is transferred by the requester through a call to the GUARDIAN File
Management procedure, WRITEREAD, against the file number of the server. A
message is transferred by the server through a pair of calls to READUPDATE and
REPLY (or their COBOL or FORTRAN equivalents) against $RECEIVE. One-way
communication — a READ instead of a READUPDATE call, will cause an error.
Figure 7-2 illustrates two-way communication consisting of request and reply
messages.
Figure 7-2. Query Processor and ENFORM Server Communication
WRITEREAD
Query
Processor
(requester)
Request
Reply
READUPDATE
REPLY
ENFORM
Server
The preceding discussion of interprocess communication assumes that you write
ENFORM servers as “non-queuing servers”, that is, servers that always reply to a
request read from $RECEIVE before they read another request. Although they are
potentially more complicated, you could, however, write “queuing servers”; that is,
servers that sometimes will read a request from $RECEIVE before replying to the
request previously read from $RECEIVE.
For more information on interprocess communication and queuing servers, refer to the
GUARDIAN Operating System Programmer’s Guide.
The interprocess messages used by the Command Interpreter (CI), the query processor
(QP), and an ENFORM server are shown in Table 7-1. The effect of a message on an
ENFORM server is reflected by a change in the condition of the server; that is, the
message prepares the server for the next operation.