XNSStreamPrivate.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Demers, January 8, 1987 0:34:16 am PST
DIRECTORY
Basics USING [FWORD, HWORD],
BasicTime USING [Pulses],
Rope USING [ROPE],
XNS USING [Address],
XNSBuf USING [Buffer],
XNSSocket USING [Handle],
XNSSPPBuf USING [Buffer, maxBodyBytes],
XNSSPPTypes USING [defaultSST],
XNSStream USING [AttentionType, CloseReason, Milliseconds, SubSequenceType];
XNSStreamPrivate: CEDAR DEFINITIONS
~ {
Copied Types
FWORD: TYPE ~ Basics.FWORD;
HWORD: TYPE ~ Basics.HWORD;
XNSBuffer: TYPE ~ XNSBuf.Buffer;
SPPBuffer: TYPE ~ XNSSPPBuf.Buffer;
SubSequenceType: TYPE ~ XNSStream.SubSequenceType;
AttentionType: TYPE ~ XNSStream.AttentionType;
Sequence Numbers
SignedDiff: PROC [a, b: CARD16] 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: CARD16,
attentionType: AttentionType];
unknownConnectionID: HWORD ~ [0, 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,
Auxiliary processes associated with stream:
auxProcCnt: CARDINAL ← 0,
auxProcsDone: CONDITION,
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: CARD16 ← 0,
sentAllocNum: CARD16 ← 0,
recvdAllocNum: CARD16 ← 0,
heWantsAlloc: BOOLFALSE,
mustSendAck: BOOLFALSE,
Ring of input buffers:
inputEnqueue: Finger ← NIL,
inputEnqueueNum: CARD16 ← 0,
inputAck: Finger ← NIL,
inputAckNum: CARD16 ← 0,
inputDequeue: Finger ← NIL,
inputDequeueNum: CARD16 ← 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: CARD16 ← 0,
outputSend: Finger ← NIL, 
outputSendNum: CARD16 ← 0,
outputDequeue: Finger ← NIL,
outputDequeueNum: CARD16 ← 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 ← XNSSPPTypes.defaultSST,
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
];
}.