-- NetworkStream.mesa (last edited by: Garlick on: January 26, 1981 9:55 AM)
DIRECTORY
IO USING [STREAM],
NSAddress USING [NetworkAddress];
NetworkStream: DEFINITIONS =
BEGIN
-- definitions
-- various types and constants used by Network Stream clients.
WaitTime: TYPE = LONG CARDINAL; -- msecs
defaultWaitTime: WaitTime = 60000; -- msecs
infiniteWaitTime: READONLY WaitTime;
ClassOfService: TYPE = {bulk, transactional};
SuspendReason: TYPE = {
notSuspended, transmissionTimeout, noRouteToDestination,
remoteReject, remoteServiceDisappeared};
FailureReason: TYPE = {
timeout, noRouteToDestination, noServiceAtDestination, -- all media
-- the following apply only to circuit-oriented networks (e.g. phone network)
noAnswerOrBusy, -- auto-dial case only
noTranslationForDestination, -- no phone number for this destination
circuitInUse, -- being used to talk to another destination
circuitNotReady, -- dial the phone or connect modems (non-auto-dial case)
noDialingHardware, dialerHardwareProblem};
ListenerHandle: TYPE [2];
uniqueNetworkAddr: READONLY NSAddress.NetworkAddress;
ConnectionID: TYPE = RECORD [WORD];
uniqueConnID: ConnectionID = [0];
unknownConnID: ConnectionID = [0];
-- interface
-- exported by NetworkStreamMgr
-- procedures
-- This procedure creates a network stream to the specified remote address.
Create: PROCEDURE [remote: NSAddress.NetworkAddress, timeout: WaitTime ←
defaultWaitTime, classOfService: ClassOfService ← bulk]
RETURNS [IO.STREAM];
-- This procedure creates the sequenced packet transducer with all its parameters
CreateTransducer: PROCEDURE [local, remote: NSAddress.NetworkAddress, localConnID,
remoteConnID: ConnectionID, activelyEstablish: BOOLEAN, timeout: WaitTime ←
defaultWaitTime, classOfService: ClassOfService ← bulk]
RETURNS [IO.STREAM];
AssignNetworkAddress: PROCEDURE RETURNS [NSAddress.NetworkAddress];
FindAddresses: PROCEDURE [sH: IO.STREAM]
RETURNS [local, remote: NSAddress.NetworkAddress];
SetWaitTime: PROCEDURE [sH: IO.STREAM, time: WaitTime];
CreateListener: PROCEDURE [addr: NSAddress.NetworkAddress]
RETURNS [ListenerHandle];
DeleteListener: PROCEDURE [listenerH: ListenerHandle];
Listen: PROCEDURE [listenerH: ListenerHandle, listenTimeout: WaitTime ←
infiniteWaitTime, streamTimeout: WaitTime ← infiniteWaitTime, classOfService:
ClassOfService ← bulk]
RETURNS [IO.STREAM];
-- errors and signals
ConnectionSuspended: ERROR [why: SuspendReason];
ConnectionFailed: SIGNAL [why: FailureReason];
IllegalAddress: ERROR; -- illegal network address for CreateListener
ListenTimeout: SIGNAL; -- resumeable
-- optional close protocol using subsequence types
-- definitions
CloseStatus: TYPE = {good, noReply, incomplete};
SubSequenceType: TYPE = [0..256);
closeSST: SubSequenceType = 254;
closeReplySST: SubSequenceType = 255;
-- interface
-- exported by NetworkStreamMgr
-- procedures
Close: PROCEDURE [sH: IO.STREAM] RETURNS [CloseStatus];
CloseReply: PROCEDURE [sH: IO.STREAM] RETURNS [CloseStatus];
END.
LOG
(trimmed to Teak)
Time: January 22, 1980 10:37 PM By: Dalal Action: made ListenerHandle a LONG.
Time: January 22, 1980 10:37 PM By: BLyon Action: Changed SpecialNSAddress to NSAddress, ListenerHandle is opaque TYPE, made uniqueNetworkAddress READONLY (from CONSTANT).
Time: August 6, 1980 10:21 AM By: Garlick Action: Added several FailureReason's for circuit-oriented networks.
Time: October 10, 1980 4:47 PM By: Garlick Action: Added FailureReason noAnswerOrBusy.
Time: January 26, 1981 9:55 AM By: Garlick Action: Added FailureReason noServiceAtDestination and SuspendReason remoteServiceDisappeared. Deleted ERROR AttentionTimeout and added SIGNAL ListenTimeout. Made several timeout values default. Added a ClassOfService parameter to Create, CreateTransducer, and Listen. Added infiniteWaitTime.