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

Examples
NonStop TS/MP Pathsend and Server Programming Manual132500
B-8
Pathsend Requester Example
?PAGE "STRUCTURE OF THE CONTROL BLOCK"
?SECTION CONTROL^BLOCK
! This structure is used to keep data about a Pathsend send or
! message log write. Control blocks (cb's) are allocated from the
! upper 32K using GETPOOL.
! For each transaction, which is driven by data from one record in
! the input file, 3 cb's are allocated (one each for the Pathsend
! sends, and one for the message log write) and linked together in a
! linked list. At transaction completion, the cb memory is returned
! using PUTPOOL.
STRUCT control^block^template (*);
BEGIN
INT type; ! Pathsend cb or msg log cb (see types below)
INT fnum; ! file # of msg log file if cb type is msg log
INT scsend^opnum = fnum; ! sc send op # if cb type is Pathsend
INT record^number; ! corresponding input file rec number
INT io^buf [0: $MAX ($LEN (pathsrv^request^template), ! I/O buf
$LEN (pathsrv^reply^template)) - 1]; ! for sends
! and writes.
STRUCT pathsend^req^buf (pathsrv^request^template) = io^buf;
! for sends
STRUCT pathsend^reply^buf (pathsrv^reply^template) = io^buf;
! for sends
INT .input^data^buf (breq^input^rec^template ) = io^buf;
! for writes, a ptr
STR .pathmon^system^and^process^name; ! pointer into input buf
STR .serverclass^name; ! pointer into input buf
INT pathsend^error; ! if error on send
INT file^system^error; ! if error on send or write
UNSIGNED (1) io^posted; ! if send or write outstanding
UNSIGNED (1) error^is^retryable; ! if we can retry i/o
UNSIGNED (14) not^used; ! filler
STR pathsend^error^msg [0:77]; ! text for pathsend error
STR file^system^error^msg [0:77]; ! text for filesys error
INT .EXT next^cb (control^block^template); ! ptr to next cb in list,
END; ! must be last field in struct
! Types of control blocks. A cb can be used for a PATHSEND send or
! used for a message log write.
LIT cb^type^pathsend = 1;
LIT cb^type^msg^log = 2;