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.