-- PDChatServerImpl.mesa
-- Copyright (C) 1984, Xerox Corporation.  All rights reserved.
-- Michael Plass, 14-Sep-84 13:13:18
	-- 
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;
	
	PupDefs.PupPackageMake[];
	
	pupListener ← PupStream.CreatePupByteStreamListener[
		local: PupTypes.telnetSoc,
		proc: NewConnection,
		ticks: PupStream.SecondsToTocks[600]
		];
		
	END.