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

Examples
NonStop TS/MP Pathsend and Server Programming Manual132500
B-30
Pathsend Requester Example
! Start the Pathsend send to the server class. Fill the send buf
! with blanks so there's not a cascading Pathsend send from server
! to server class.
cb.io^buf ':=' " " & cb.io^buf FOR $OCCURS (cb.io^buf) - 1;
! Set up the ServerClass_Send_ parameters: get the PATHMON name and
! server class name lengths, and set the values for <flags> and
! <timeout>.
len := $OCCURS (cb.pathsend^req^buf.pathmon^system^and^process^name) - 1;
WHILE cb.pathmon^system^and^process^name [len] = " " OR
cb.pathmon^system^and^process^name [len] = 0
DO ! skip blanks and nulls
len := len - 1;
pathmon^process^name^len := len + 1;
len := $OCCURS (cb.pathsend^req^buf.server^class) - 1;
WHILE cb.serverclass^name [len] = " " OR
cb.serverclass^name [len] = 0
DO ! skip blanks and nulls
len := len - 1;
serverclass^name^len := len + 1;
! Setting bit 15 in flags means send nowaited. Setting timeout to
! -1D means we're willing to wait forever for the send to complete,
! and LINKMON will not cause this send to time out.
! Remember, when a Pathsend send times out (AWAITIOX completes with
! error 233 and ServerClass_Send_Info returns file system error 40),
! the outstanding I/O to the server process is cancelled.
! Note that setting a timeout value here is independent of setting a
! timeout value in the call to AWAITIOX.
flags.<15> := 1;
timeout := -1D;
! Initiate the Pathsend I/O. If no error is returned from
! SERVERCLASS_SEND_, then the I/O is successfully initiated.
! If an error is returned, then the I/O was NOT successfully
! initiated and NO I/O to a server process is outstanding.
! NOTE: A value of -1 is returned in the <scsend-op-num> param for
! waited sends. A value of -1 is also returned for nowaited sends
! that are not successfully initiated.