// IfsRSMgrRes.bcpl - Rendezvous Socket Manager - RESIDENT
// Copyright Xerox Corporation 1979

// Last modified May 20, 1979  11:16 PM by Boggs

get "Pup0.decl"
get "Pup1.decl"
get "IfsRs.decl"

external
[
// outgoing procedures
RsMgrEvent; ShiftSwatEvent

// incoming procedures
QueueEvent; HandleRSPup; HandleKeys

// incoming statics
rsQ
]


//----------------------------------------------------------------------------
let RsMgrEvent(ecb) be
//----------------------------------------------------------------------------
//Checks rendezvous socket input queues for RFCs
[
let rs = rsQ
   [
   rs = rs!0
   if rs eq 0 break
   if rs>>RS.soc>>PupSoc.iQ.head ne 0 then HandleRSPup(rs)
   ] repeat
QueueEvent(ecb, 25)  //250 ms to next check
]


//----------------------------------------------------------------------------
and ShiftSwatEvent(ecb) be
//----------------------------------------------------------------------------
//Checks for shift-swat abort and other interesting events
[
// Keyboard word 177037b contains Lock, Space, and Swat.  Ignore Lock.
if (@177037b & 177577b) ne 177577b then HandleKeys()
QueueEvent(ecb, 25)  //250 ms to next check
]