// IfsTelnetRes.bcpl -- resident portion of IFS server telnet
// Copyright Xerox Corporation 1979
// Last modified March 7, 1980  6:55 PM by Taft

get "IfsRs.decl"

external
[
// outgoing procedures
TelnetEvent

// incoming procedures
TelnetProcess; QueueEvent

// outgoing statics
telnetEvents

// incoming statics
jobT; lenJobT
]

static telnetEvents


//---------------------------------------------------------------------------
let TelnetEvent(ecb) be
//---------------------------------------------------------------------------
// Does periodic telnet processing for all telnet jobs
[
for i = 0 to lenJobT-1 do
   [
   let ctx = jobT>>JobT↑i
   if ctx ne 0 & ctx>>RSCtx.type eq jobTypeTelnet then TelnetProcess(ctx)
   ]
telnetEvents = telnetEvents +1  //for race avoidance--see CleanupTelnetJob
QueueEvent(ecb, 4)  //check again in 40 ms
]