TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)

Writing Pathway Servers
NonStop TS/MP Pathsend and Server Programming Manual132500
4-2
Guardian Servers and Pathway Servers
Guardian Servers and Pathway Servers
Like a Guardian server, a Pathway server receives messages by reading the Guardian
$RECEIVE file. However, unlike a Guardian server, it does not receive its messages
directly from a requester program, but instead receives them from an intermediate
process: either a LINKMON process or a terminal control process (TCP). Whereas a
Guardian server receives open messages, I/O messages, and close messages from the
requester, a Pathway server receives all these messages from the LINKMON process or
the TCP. A Pathway server receives no information about the identity of the requester
process that initiated the communication, unless the requester provides that information
in the messages it sends.
The LINKMON process’s open of the server process is shared among all the Pathsend
requester processes running in the same processor as that LINKMON process.
Therefore, a close does not necessarily occur when the communication with a particular
requester process is finished.
Server Stop Protocol
A Pathway server must stop itself when the LINKMON process or the TCP closes it on
behalf of the last requester that has a link to it. Otherwise, the PATHMON process
considers the server process to be in the PENDING state.
Handling of Messages from $RECEIVE
COBOL85 servers always perform all of the I/O for the request message most recently
read from $RECEIVE and always reply to that message before reading another message.
For simplicity, this is the protocol servers should follow in most cases.
If you do need to write a multithreaded server or a context-sensitive server that performs
queuing of messages from $RECEIVE, you must write this portion of your server
program in a language other than COBOL85.
Pathsend Requester Failures
A Pathsend requester process can fail for reasons that include the following: the
requester process calls ABEND, a processor fails, or someone stops the process.
When a Pathsend requester process fails with outstanding I/O operations, the effect is
similar to that of a failure of any Guardian process with outstanding I/O; that is, all
outstanding I/O operations are canceled, including those for outstanding server-class
send operations. As a result, the target server process might get cancellation messages
related to the outstanding calls to SERVERCLASS_SEND_,
SERVERCLASS_DIALOG_BEGIN_, or SERVERCLASS_DIALOG_SEND_.
However, the target server process does not get a close message, as it would have from a
Guardian file-system open. Except in the case of a processor failure, the links that the
LINKMON process established with server processes on behalf of the Pathsend
requester are maintained, because these links are shared. Therefore, servers must
monitor cancel messages, rather than close messages, to determine when a pending reply
is no longer needed.