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

Examples
NonStop TS/MP Pathsend and Server Programming Manual132500
B-40
Pathsend Requester Example
WHILE @cb <> nil^addr
DO
BEGIN
IF cb.type = cb^type^pathsend AND cb.pathsend^error
THEN ! an error occurred on this Pathsend send
BEGIN
IF NOT cb.error^is^retryable
THEN ! the transaction isn't retryable
RETURN false;
transaction^is^retryable := true;
END;
@cb := @cb.next^cb;
END;
RETURN transaction^is^retryable;
END; ! INT PROC retryable^transaction
?PAGE "RETURN THE CONTROL BLOCK MEMORY TO THE POOL"
! After we are done using all the control blocks in a list, return
! the memory allocated for each control block.
PROC return^control^block^memory (cb^list^head);
INT .EXT cb^list^head (control^block^template);
BEGIN
INT .EXT cb (control^block^template) := @cb^list^head;
INT .EXT next^cb (control^block^template);
INT .buf [0:79];
STR .sbuf := @buf '<<' 1;
STR .sp;
WHILE @cb <> nil^addr DO
BEGIN
! Save the address of the next element in the list before we
! return the current list element.
@next^cb := @cb.next^cb;
CALL PUTPOOL (PoolHead, cb);
IF <
THEN ! couldn't return the memory
BEGIN
sbuf ':=' "PUTPOOL FAILED TO RETURN MEMORY" -> @sp;
CALL WRITE (error^log^fnum, buf, @sp '-' @sbuf);
IF <
THEN ! print an error msg and abend
CALL IO^error (error^log^fnum);
CALL ABEND;
END; ! if
@cb := @next^cb;
END; ! while
END; ! PROC return^control^block^memory
?PAGE "LOOK AT WHY SERVERCLASS_SEND_INFO_ FAILED"