TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)
Examples
NonStop TS/MP Pathsend and Server Programming Manual–132500
B-45
Pathsend Requester Example
?PAGE "STORE DATA IN THE CONTROL BLOCK"
! This proc stores data to make one Pathsend send or one write to
! the message log file. The data is from one input record, and is
! stored in the control block that's passed into this procedure.
PROC store^control^block^info (cb, data^buf, cb^type, record^number);
INT .EXT cb (control^block^template);
STR .data^buf (pathsrv^request^template);
INT cb^type;
INT record^number;
BEGIN
IF cb^type <> cb^type^pathsend AND cb^type <> cb^type^msg^log
THEN ! assertion failed
CALL abend^with^my^abend^msg;
cb.type := cb^type;
cb.record^number := record^number;
IF cb.type = cb^type^pathsend
THEN ! store data necessary to do a Pathsend send
BEGIN
@cb.pathmon^system^and^process^name :=
@data^buf.pathmon^system^and^process^name;
@cb.serverclass^name := @data^buf.server^class;
END
ELSE ! the cb is for a write to msg log
BEGIN
@cb.input^data^buf := @data^buf '>>' 1;
END;
END; ! PROC store^control^block^info
?PAGE "VALIDATE A REQUEST RECORD"
! A valid request is in the format of breq^input^rec^template, and
! contains data needed to make 2 Pathsend sends. The data is a
! PATHMON name (either explicit or an ASSIGN) and a server class
! name.
! If an ASSIGN is specified, then this proc looks up the ASSIGN name
! in our ASSIGN table and puts the corresponding file name into the
! PATHMON system and process name field of the input record.
! This proc returns the outcome of the validation check to the
! caller.
INT PROC validate^breq^input (input^rec);
INT .input^rec (breq^input^rec^template);
BEGIN
INT i;
INT .buf [0:79] := [80*[" "]];
STR .sbuf := @buf '<<' 1;
STR .sp;
STR .logical^name[0:30];
INT .assign^ (ci^assign);