PDChatServerStub.mesa
Copyright (C) 1984, Xerox Corporation. All rights reserved.
Michael Plass, September 11, 1984 3:54:15 pm PDT
DIRECTORY PupTypes, PupDefs, PupStream, IO, Rope, Stream, PDUser;
PDChatServerStub: CEDAR PROGRAM
IMPORTS PupDefs, PupStream, Stream, PDUser
= BEGIN
NewConnection: PROCEDURE [stream: IO.STREAM, pupAddress: PupDefs.PupAddress] = TRUSTED {
otherGuy: Rope.ROPE ← PupDefs.GetHostName[pupAddress];
s: Stream.Handle ← Stream.FromIOStreams[stream, stream];
PDUser.TalkWithUser[s ! PupStream.StreamClosing => CONTINUE];
Stream.Delete[s];
};
pupListener: PupStream.PupListener ← PupStream.CreatePupByteStreamListener[
local: PupTypes.telnetSoc,
proc: NewConnection,
ticks: PupStream.SecondsToTocks[300]
];
END.