-- File: PupStream.Mesa, Last Edit: HGM March 3, 1980 4:02 PM
-- Copyright Xerox Corporation 1979, 1980
DIRECTORY
Stream: FROM "Stream" USING [Handle],
PupDefs: FROM "PupDefs" USING [
NameLookupErrorCode,
Tocks, veryLongWait, veryShortWait],
PupTypes: FROM "PupTypes" USING [Pair, PupAddress, PupHostID, PupNetID, PupSocketID];
PupStream: DEFINITIONS =
BEGIN
-- Copied things from PupTypes
PupAddress: TYPE = PupTypes.PupAddress;
PupNetID: TYPE = PupTypes.PupNetID;
PupHostID: TYPE = PupTypes.PupHostID;
PupSocketID: TYPE = PupTypes.PupSocketID;
PupOpenMode: TYPE = {alreadyOpened, sendRfc, wait};
CloseReason: TYPE = {localClose, remoteClose,
noRouteToNetwork, transmissionTimeout, remoteReject };
-- Byte Stream Interface
PupByteStreamCreate: PROCEDURE [remote: PupAddress, ticks: Tocks]
RETURNS [Stream.Handle];
-- Listeners
PupListener: TYPE = POINTER TO PupListenerObject;
PupListenerObject: TYPE = RECORD [PROCEDURE];
CreatePupByteStreamListener: PROCEDURE [
local: PupSocketID, proc: PROCEDURE[Stream.Handle,PupAddress], ticks: Tocks,
filter: PROCEDURE [PupAddress] ← DontReject]
RETURNS [PupListener];
DestroyPupListener: PROCEDURE [PupListener];
DontReject: PROCEDURE [PupAddress];
RejectThisRequest: ERROR [error: STRING];
-- Used only by Listeners+Debugging
PupByteStreamMake: PROCEDURE [
local: PupSocketID, remote: PupAddress, ticks: Tocks,
mode: PupOpenMode, id: PupTypes.Pair]
RETURNS [Stream.Handle];
-- Start and Stop
AdjustBufferParms: PROCEDURE [ bufferPoolSize, bufferSize: CARDINAL ];
PupPackageMake: PROCEDURE;
PupPackageDestroy: PROCEDURE;
-- NameConversion
GetPupAddress: PROCEDURE[a: POINTER TO PupAddress, s: STRING];
AppendPupAddress: PROCEDURE [s: STRING, a: PupAddress];
-- ERRORs
StreamClosing: ERROR [why: CloseReason, text: STRING];
PupNameTrouble: ERROR [e: STRING, code: PupDefs.NameLookupErrorCode];
TockConversionTroubles: ERROR;
-- Timeout things
Tocks: TYPE = PupDefs.Tocks;
veryLongWait: Tocks = PupDefs.veryLongWait;
veryShortWait: Tocks = PupDefs.veryShortWait;
SecondsToTocks: PROCEDURE [CARDINAL] RETURNS [Tocks];
MsToTocks: PROCEDURE [CARDINAL] RETURNS [Tocks];
-- Performance tuning and debugging
-- Call these before creating the connection
SetMaxAllocation: PROCEDURE [CARDINAL];
SetMaxBufferSize: PROCEDURE [CARDINAL];
SetPinging: PROCEDURE [BOOLEAN];
END.