TMF Application Programmer's Guide (G06.24+)
TMF Programming Environment
HP NonStop TMF Application Programmer’s Guide—522419-004
1-6
The Requester/Server Model
The Requester/Server Model
Many business applications that run on HP systems use the requester/server
application design model to obtain input from end users and apply it to a database.
In the most elementary case, a requester is the process that receives the initial request
to perform a business operation requiring modification of a database. The requester
then initiates a TMF transaction, calls one or more server processes to make the
necessary changes to the database, terminates the transaction, and responds to the
end user (or to the application module that represents an end user).
In reality, however, application modules are usually much more complex than that.
Requester and server modules can be designed to work on more than one transaction
at a time; this is referred to as “multithreaded operation.” In addition to delegating the
work for a particular transaction to one or more servers, a requester can update a
database directly. Furthermore, a single application module can even function
simultaneously as a requester for some transactions and as a server for others.
TMF requesters can be coded in C, C++, COBOL85, FORTRAN, Pascal, SCREEN
COBOL, or TAL.
TMF servers can be coded in C, C++, COBOL85, FORTRAN, Pascal, or TAL.
Within the TMF environment, requesters and servers communicate with one another
over the message system.
To communicate with a server, a requester must first open the server process by using
the OPEN system procedure. The OPEN procedure includes, as its first parameter,
the server process’ name instead of a file name. All necessary process names, in local
and network form, can be predefined so that the particular processes are known
throughout both the system and the network.
To send a request to a server and receive a reply, the requester uses the WRITEREAD
procedure (specifying the filenumber returned by OPEN). Note that SCREEN
COBOL requesters use the SEND verb to communicate with servers.
After opening a server, a requester will often leave it open indefinitely. Eventually,
however, the requester terminates its communication path to the server by using the
CLOSE system procedure.
To communicate with a requester, a server must open a special file named $RECEIVE.
Thereafter, the server accepts work request messages from requesters by using the
READUPDATE system procedure to read from $RECEIVE. When the server has
completed all of the operations associated with a particular work request, it responds to
the requester by using the REPLY system procedure.