Guardian Programmer's Guide

Table Of Contents
Writing a Server Program
Guardian Programmer’s Guide 421922-014
22 - 11
The Part-Query Server ($SER1)
The following paragraphs describe the major procedures in detail.
The SERVER Procedure
The SERVER procedure is the main procedure for the part-query server. It provides
three main functions:
Calls INIT to perform server initialization
Calls a procedure based on messages received on $RECEIVE
Replies to the message read from $RECEIVE
The server-initialization phase performed by INIT involves reading the Startup
message, opening the home terminal, and opening the inventory file.
The rest of the SERVER procedure responds to messages read from $RECEIVE. If
the message is a system message, then the procedure calls the
PROCESS^SYSTEM^MESSAGE procedure. If the message received is a user
message, then the procedure calls the PROCESS^USER^REQUEST procedure.
Before calling either of these procedures, the SERVER procedure calls the
FILE_GETRECEIVEINFO_ system procedure to get the process handle of the process
that sent the message. This process handle is used later for controlling access to the
server.
Figure 22-3. Relationship Between Major Procedures in the Part-Query Server
VST110.VSD