-- Copyright (C) 1984  by Xerox Corporation. All rights reserved. 
-- RPCEchoServer.mesa, HGM, 21-Jan-84 20:37:34

DIRECTORY
  MesaRPCLupine USING [Dispatcher, ExportHandle, ExportInterface];

RPCEchoServer: MONITOR IMPORTS MesaRPCLupine =

  BEGIN

  expHandle: MesaRPCLupine.ExportHandle;
  
  packets: LONG CARDINAL ← 0;
  words: LONG CARDINAL ← 0;

  MultiPacket: ERROR = CODE;

  EchoDispatcher: MesaRPCLupine.Dispatcher =
    BEGIN
    IF ~lastPkt THEN ERROR MultiPacket[];
    packets ← packets + 1;
    words ← words + callLength;
    RETURN[callLength];
    END;

  expHandle ← MesaRPCLupine.ExportInterface[NIL, TRASH, ["RPC-Echo"L, NIL], EchoDispatcher, [0, 0]];

  END.