DIRECTORY IO USING [STREAM], PupTypes USING [Pair, PupAddress, PupHostID, PupNetID, PupSocketID], Rope USING [ROPE]; PupStream: CEDAR DEFINITIONS = BEGIN PupAddress: TYPE = PupTypes.PupAddress; PupNetID: TYPE = PupTypes.PupNetID; PupHostID: TYPE = PupTypes.PupHostID; PupSocketID: TYPE = PupTypes.PupSocketID; Tocks: TYPE = RECORD [CARDINAL]; veryLongWait: Tocks = [LAST[CARDINAL]]; veryShortWait: Tocks = [0]; PupOpenMode: TYPE = {alreadyOpened, sendRfc, wait}; CloseReason: TYPE = { localClose, localAbort, remoteClose, noRouteToNetwork, transmissionTimeout, remoteReject}; PupByteStreamCreate: PROCEDURE [remote: PupAddress, ticks: Tocks] RETURNS [IO.STREAM]; PupByteStreamAbort: PROCEDURE [IO.STREAM, Rope.ROPE]; -- instead of clean close SendMark: PROCEDURE[IO.STREAM, [0..256)]; -- send mark byte ConsumeMark: PROCEDURE[IO.STREAM] RETURNS [ [0..256) ]; -- legal iff EndOf[] SendAttention: PROCEDURE[IO.STREAM]; -- sends asynchronous "interrupt" on stream WaitAttention: PROCEDURE[IO.STREAM]; -- waits until other end sends an "interrupt". TimeOut: SIGNAL[nextIndex: INT]; StreamClosing: ERROR [why: CloseReason, text: Rope.ROPE]; PupListener: TYPE = REF PupListenerObject; PupListenerObject: TYPE; CreatePupByteStreamListener: PROCEDURE [ local: PupSocketID, proc: PROCEDURE [IO.STREAM, PupAddress], ticks: Tocks, filter: PROCEDURE [PupAddress] _ DontReject] RETURNS [PupListener]; DestroyPupListener: PROCEDURE [PupListener]; DontReject: PROCEDURE [PupAddress]; RejectThisRequest: SAFE ERROR [error: Rope.ROPE]; PupByteStreamMake: PROCEDURE [ local: PupSocketID, remote: PupAddress, ticks: Tocks, mode: PupOpenMode, id: PupTypes.Pair] RETURNS [IO.STREAM]; SetMaxAllocation: PROCEDURE [CARDINAL]; SetMaxBufferSize: PROCEDURE [CARDINAL]; SetPinging: PROCEDURE [BOOLEAN]; SecondsToTocks: PROCEDURE [CARDINAL] RETURNS [Tocks]; MsToTocks: PROCEDURE [CARDINAL] RETURNS [Tocks]; PupPackageMake: PROCEDURE; PupPackageDestroy: PROCEDURE; GetPupAddress: SAFE PROC [PupSocketID, Rope.ROPE] RETURNS[ PupAddress ];--Parse or NameLookup PupNameLookup: SAFE PROC [PupSocketID, Rope.ROPE] RETURNS[ PupAddress ];--NameLookup only NameLookupErrorCode: TYPE = {noRoute, noResponse, errorFromServer}; -- if error PupNameTrouble: ERROR [e: Rope.ROPE, code: NameLookupErrorCode]; TockConversionTroubles: ERROR; END. ÒPupStream.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. HGM January 15, 1981 6:36 PM Andrew Birrell May 12, 1983 10:55 am Copied things from PupTypes TYPEs Byte Stream Interface ERRORs Raised during input operation if no data arrives within the interval specified when the stream was created (even although the other end is responding to our probes). Raised during i/o operation if stream has been aborted or closed by either end, or if the other end is not responding to our probes. Also raised when creating a stream if creation fails. Listeners Used only by Listeners+Debugging Performance tuning and debugging Call these before creating the connection Tocks On/Off NameConversion ERRORs Êè˜codešœ™Kšœ Ïmœ1™