-- PDChatServerImpl.mesa
-- Copyright (C) 1984, Xerox Corporation.  All rights reserved.
-- Michael Plass, 14-Sep-84 13:13:18
-- Tim Diebert,  5-Sep-86 15:20:49 
-- 
DIRECTORY PupTypes, PupDefs, PupStream, Stream, PDUser;
   
PDChatServerImpl: PROGRAM
   IMPORTS PupDefs, PupStream, Stream, PDUser
   = BEGIN
      
   NewConnection: PROCEDURE [stream: Stream.Handle, pupAddress: PupDefs.PupAddress] = {
      PDUser.TalkWithUser[stream ! PupStream.StreamClosing => CONTINUE];
      Stream.Delete[stream];
      };
      
   pupListener: PupStream.PupListener;
   
   Init: PROC [] = BEGIN
      [] ← PupDefs.PupPackageMake[];
      pupListener ← PupStream.CreatePupByteStreamListener[
         local: PupTypes.telnetSoc,
         proc: NewConnection,
         ticks: PupStream.SecondsToTocks[600]
         ];
      END;
   
   Init[];   
   END.