TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)
Examples
NonStop TS/MP Pathsend and Server Programming Manual–132500
B-42
Pathsend Requester Example
?PAGE "SET UP THE CONTROL BLOCKS FOR ONE TRANSACTION"
! Here we get memory for each control block (cb) used in the
! transaction, and we store data from the input record into the cb.
! The data we store is data necessary to execute that part of the
! transaction, a Pathsend send or msg log WRITE.
! This proc returns the address of the first element in the list of
! control blocks.
DBL PROC setup^control^blocks (input^buf, record^number);
INT .input^buf (breq^input^rec^template); ! input buffer
INT record^number; ! input file rec num
BEGIN
INT .EXT cb^list^head (control^block^template) := nil^addr;
INT .EXT cb (control^block^template);
! We pass into get^control^block the head of a list, and it creates
! a new cb and links it onto the end of the list. If we pass in a
! list head with nil address, then list head becomes the first
! element in the list.
@cb^list^head := get^control^block (cb^list^head);
! Store data into this control block, used for the first Pathsend
! send.
CALL store^control^block^info (cb^list^head, input^buf.server^request[0],
cb^type^pathsend, record^number);
! Get the second element in the list, used for the WRITE to the msg
! log file, and link it to the end of the list.
@cb := get^control^block (cb^list^head);
CALL store^control^block^info (cb, input^buf, cb^type^msg^log,
record^number);
! Get the third element in the list, used for the second Pathsend
! send, and link it to the end of the list.
@cb := get^control^block (cb^list^head);
CALL store^control^block^info (cb, input^buf.server^request[1],
cb^type^pathsend, record^number);
RETURN @cb^list^head;
END; ! DBL PROC setup^control^blocks