Envoy Application Programming Manual

Table Of Contents
TINET Multipoint Supervisor Protocol
Envoy Application Programming Manual427159-001
8-38
Steps of Example Program
Example 8-15. Program Code for TINET Multipoint Supervisor (Page 6 of 13)
line^cntread := 0;
IF id <> -1 THEN ! save return to caller.
BEGIN
return^p := l[stack^p];
return^e := l[stack^e];
return^l := l[stack^l];
buf^addr := @buffer;
cnt^addr := @count^read;
END;
IF start THEN CALL return^to^task (-1); ! return to
! start^up.
! set ’S’ above task’s data areas.
STACK (system^call^base); CODE (SETS);
! poll the network.
WHILE 1 DO
BEGIN
CALL READ (linefnum, linebuf, line^readcount,
line^cntread);
IF = THEN ! terminal responded to poll.
BEGIN
! return data to appropriate task.
CALL return^to^task (linebuf.8:15 );
END
ELSE ! line error occurred.
BEGIN
id := linebuf.8:15 ;
CALL FILEINFO (linefnum, lerror);
IF lerror = no^response OR lerror = bad^reply
THEN
IF (term^state := term^state + 1) >
max^failures THEN
! disable polling for this terminal.
saddr^list[ id * addr^size * 2 ] := eot
+ no^poll
ELSE
! clear nonresponding list.
CALL CHANGELIST (linefnum, -2, 0)
ELSE
IF lerror = max^naks OR lerror = overrun THEN
! clear terminal.
CALL CONTROL (linefnum, 14) ! send enq.
ELSE
BEGIN
! report error on operator console.
! disable polling for this terminal.
saddr^list[ id * addr^size * 2 ] := eot
+ no^poll;
END;
END;
END; ! while 1 loop.
END; ! poll^line.