TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)
Examples
NonStop TS/MP Pathsend and Server Programming Manual–132500
B-39
Pathsend Requester Example
INT read^count;
INT .error;
BEGIN
INT status;
DBL LineNum;
! If status >= 0, the read was successful and status contains the
! count of chars in the text line. Actual bytes transferred <=
! read^count. If status < 0, an unrecoverable error occurred.
error := 0;
IF (status := EDITREAD (edit^control^block, buf, read^count, LineNum)) >= 0
THEN ! read was successful
RETURN true;
IF (error := status) = -1
THEN ! end of file
RETURN false;
! Unexpected error reading the IN file, print an error msg and abend
CALL IO^error (fnum);
END; ! INT PROC read^
?PAGE "SEARCH THE CONTROL BLOCKS FOR RETRYABLE ERRORS"
! Search the list of control blocks for errors that can be retried.
! All Pathsend I/O that failed must be retryable (not just one send,
! but both) for the transaction to be considered retryable.
! When a transaction is retried, we re-use the existing list of
! control blocks.
INT PROC retryable^transaction (cb^list^head);
INT .EXT cb^list^head (control^block^template); ! ptr to hd of cb list
BEGIN
INT .EXT cb (control^block^template) := @cb^list^head;
INT transaction^is^retryable := false;