TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)
Writing Pathsend Requesters
NonStop TS/MP Pathsend and Server Programming Manual–132500
3-3
Basic Pathsend Programming
Basic Pathsend Programming
The simplest type of Pathsend program is a context-free program. This subsection
provides the information you need to write a context-free Pathsend program. It also
provides information common to both context-free and context-sensitive programming.
The next subsection provides information about the additional tasks required of a
context-sensitive Pathsend program.
Context-free Pathsend programming consists simply of sending messages to a server in a
server class and receiving the replies. The sending of a message to a Pathway server
class is called a server-class send operation. In a context-free program, only two
Pathsend procedures are used: SERVERCLASS_SEND_ to send the messages (and to
receive the replies if in waited mode) and SERVERCLASS_SEND_INFO_ to get
additional information about the results of the last SERVERCLASS_SEND_ call if the
call failed.
The SERVERCLASS_SEND_ procedure enables Pathsend requesters to send data to
and receive replies from a specified Pathway server class. This procedure communicates
with the LINKMON process in the processor where the Pathsend requester is running,
passing information that enables the LINKMON process to choose a link to a server
process. After a link to the server has been obtained, the requester’s data is sent directly
from the requester’s data space to the server.
Subsequent server-class send operations to the same server class might not be sent to the
same server process; therefore, the requester must provide all necessary context on each
send.
When a server process replies to the request, the LINKMON process completes the
server-class send operation. If you use waited I/O, the reply data is in the reply buffer
when the SERVERCLASS_SEND_ call is completed. If you use nowait I/O, you
complete the I/O operation with a call to the AWAITIOX procedure.
A Pathsend requester can use the SERVERCLASS_SEND_INFO_ procedure to get
detailed information about server-class send initiation and completion errors.
Programming for Failure Recovery
A Pathsend requester must provide a mechanism for failure recovery. It can do so in one
or both of the following ways:
•
By using TMF level recovery through the Transaction Management Facility (TMF)
subsystem
•
By providing fault tolerance through process pairs and checkpointing
TMF level recovery is the recovery of the database to a consistent state through the use
of the TMF subsystem. When a failure occurs, the TMF subsystem allows the
application to back out (abort) the entire transaction, returning the contents of the
database to the values it held when the transaction was started. The application can then
retry the transaction.
In general, TMF level recovery is recommended for use with Pathsend programs: this
method is easier and faster to program than process pairs, and it handles nonretryable