XNSStreamPrivate.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Demers, June 12, 1986 12:55:37 pm PDT
DIRECTORY
BasicTime USING [Pulses],
Endian USING [FWORD, HWORD],
Rope USING [ROPE],
XNS USING [Address],
XNSBuf USING [Buffer],
XNSSocket USING [Handle],
XNSSPPBuf USING [Buffer, maxBodyBytes],
XNSStream USING [AttentionType, CloseReason, Milliseconds, SubSequenceType];
XNSStreamPrivate: CEDAR DEFINITIONS
~ {
Copied Types
BYTE: TYPE ~ [0..100H);
FWORD: TYPE ~ Endian.FWORD;
HWORD: TYPE ~ Endian.HWORD;
XNSBuffer: TYPE ~ XNSBuf.Buffer;
SPPBuffer: TYPE ~ XNSSPPBuf.Buffer;
SubSequenceType: TYPE ~ XNSStream.SubSequenceType;
AttentionType: TYPE ~ XNSStream.AttentionType;
Sequence Numbers
SignedDiff: PROC [a, b: CARDINAL] RETURNS [INTEGER] ~ INLINE {
RETURN [ LOOPHOLE[a-b] ] };
Our Types
BufIndex: TYPE = [0..XNSSPPBuf.maxBodyBytes];
FingerState: TYPE ~ { empty, emptying, halfEmpty, filling, halfFull, full, sending };
Finger: TYPE ~ REF FingerObject;
FingerObject: TYPE ~ RECORD [
next: Finger ← NIL,
state: FingerState ← empty,
attention: BOOLFALSE,
index: BufIndex ← 0,
bytes: BufIndex ← 0,
buffer: SPPBuffer ← NIL ];
OBAttn: TYPE ~ REF OBAttnObject;
OBAttnObject: TYPE ~ RECORD [
next: OBAttn,
seqNum: CARDINAL,
attentionType: AttentionType];
unknownConnectionID: HWORD ~ 0;
Handle: TYPE = REF Object;
Object: TYPE = MONITORED RECORD [
next: Handle ← NIL,
socket: XNSSocket.Handle ← NIL,
remote: XNS.Address ← NULL,
connectionID: HWORD ← unknownConnectionID,
remoteConnectionID: HWORD ← unknownConnectionID,
closed: BOOLFALSE,
closeReason: XNSStream.CloseReason ← unknown,
closeText: Rope.ROPENIL,
finished: BOOLFALSE,
Processes associated with stream:
push1: PROCESS,
push2: PROCESS,
mgr: PROCESS,
pull: PROCESS, -- TEMPORARY ????
Timeouts:
roundTripPulses: BasicTime.Pulses ← 0,
getTimeout: XNSStream.Milliseconds ← 0,
getPulseOut: BasicTime.Pulses ← 0,
putTimeout: XNSStream.Milliseconds ← 0,
putPulseOut: BasicTime.Pulses ← 0,
waitForAckPulseOut: BasicTime.Pulses ← NULL,
waitForAllocPulseOut: BasicTime.Pulses ← NULL,
cacheFlushPulseOut: BasicTime.Pulses ← NULL,
probePulseOut: BasicTime.Pulses ← NULL,
noActivityPulseOut: BasicTime.Pulses ← NULL,
Conditions:
inputSpace: CONDITION, -- Nonexistent!
inputReady: CONDITION, -- (B, T~getTimeout). There's a newly-full input buffer.
doneEmptying: CONDITION, -- (B, T~infinity).
outputSpace: CONDITION, -- (B, T~putTimeout). There's a newly-empty output buffer.
outputReady: CONDITION, -- (N, T~infinity). There's a newly-full output buffer.
recvdNewAlloc: CONDITION, -- (B, T~putTimeout).
doneFilling: CONDITION, -- (B, T~infinity).
doneSending: CONDITION, -- (B, T~infinity).
mgrShortWakeup: CONDITION, -- (X, T~waitForAck). This is how mgr times out on overdue Ack or Alloc. May be NOTIFYed by InputDequeue if it's time to send a system packet.
mgrLongWakeup: CONDITION, -- (X, T~probe). This is how mgr times out to send a probe if there's no other activity. NOTIFYed whenever an ack request is sent, and whenever mgrShortWakeup is NOTIFYed.
flusherWakeup: CONDITION, -- (B, T set by client). Broadcast whenever ??? is received.
recvdOBAttn: CONDITION, -- (B, T set by client).
Most recent significant events:
recvdTime: BasicTime.Pulses ← NULL,
cacheFlushedTime: BasicTime.Pulses ← NULL,
sentAckReqTime: BasicTime.Pulses ← NULL,
expectedAckNum: CARDINAL ← 0,
sentAllocNum: CARDINAL ← 0,
recvdAllocNum: CARDINAL ← 0,
heWantsAlloc: BOOLFALSE,
mustSendAck: BOOLFALSE,
Ring of input buffers:
inputEnqueue: Finger ← NIL,
inputEnqueueNum: CARDINAL ← 0,
inputAck: Finger ← NIL,
inputAckNum: CARDINAL ← 0,
inputDequeue: Finger ← NIL,
inputDequeueNum: CARDINAL ← 0,
inputBuffersAllocated: CARDINAL ← 0,
SubSequenceType last seen by the stream client:
inputSSType: SubSequenceType ← 0,
Out-of-Band Attentions received and not yet read by WaitAttention:
recvdOBAttnList: OBAttn ← NIL,
Ring of output buffers:
outputEnqueue: Finger ← NIL,
outputEnqueueNum: CARDINAL ← 0,
outputSend: Finger ← NIL, 
outputSendNum: CARDINAL ← 0,
outputDequeue: Finger ← NIL,
outputDequeueNum: CARDINAL ← 0,
outputBuffersAllocated: CARDINAL ← 0,
SubSequenceType that will be assigned to next data byte written by client (this ssType is attached to outputEnqueue, and may be different from the type attached to outputSend):
outputSSType: SubSequenceType ← 0,
In-Band Attentions on the output queue:
outputIBAttnCnt: CARDINAL ← 0,
Flushing: flusherCnt>0 forces each packet to be sent with its sendAck bit on. ????
flusherCnt: CARDINAL ← 0
];
}.