PacketExchange.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
BLyon on: January 20, 1981 3:00 PM
DIRECTORY
OISCPTypes USING [ExchangeClientType, ExchangeID, maxDataBytePerExchange, WaitTime],
PrincOps USING [ByteBltBlock],
NSAddress USING [NetworkAddress, SocketNumber];
PacketExchange: DEFINITIONS = BEGIN
The Packet Exchange Protocol is a request/reply protocol that provides a little more
reliability than raw packets transmitetd from a socket, and less reliabilty than the
Sequenced Packet Protocol. Usually one end will provide some service at a
well known socket or at a network address that is available through a binding
process involving the Clearinghouse. The other end acquires a socket and sends a
request. The request will be retransmitted a number of times with the interval
between retransmissions based on the delay to the remote entity.
definitions
types and constants.
Block: TYPE = PrincOps.ByteBltBlock;
ExchangeHandle: TYPE = REF PacketExchangeObject;
PacketExchangeObject: TYPE;
RequestHandle: TYPE = REF RequestObject; -- returned by WaitForRequest
RequestObject: TYPE = RECORD [
nBytes: CARDINAL, -- the byte size of the request Block
requestType: OISCPTypes.ExchangeClientType,
the next to fields are used in the reply; clients should not touch these.
requestersExchangeID: PRIVATE OISCPTypes.ExchangeID,
requestersAddress: PRIVATE NSAddress.NetworkAddress];
maxBlockLength: CARDINAL = OISCPTypes.maxDataBytePerExchange; -- in bytes
ErrorReason: TYPE = {
blockTooBig, blockTooSmall, noDestinationSocket,
noRouteToDestination, hardwareProblem, aborted, timeout};
defaultWaitTime: OISCPTypes.WaitTime = 60000; -- in msecs
interface
errors and signals
Error: ERROR [why: ErrorReason];
Timeout: SIGNAL; -- this may be RESUMEd
procedures
the requestor
CreateRequestor: PROCEDURE [waitTime: OISCPTypes.WaitTime ← defaultWaitTime] RETURNS [ExchangeHandle]; -- at any socket number
SendRequest: PUBLIC PROCEDURE [h: ExchangeHandle, remote: NSAddress.NetworkAddress,
requestBlk, replyBlk: Block,
requestType: OISCPTypes.ExchangeClientType ← unspecified]
RETURNS [nBytes: CARDINAL, replyType: OISCPTypes.ExchangeClientType];
the replyer
CreateReplyer: PROCEDURE [localSocket: NSAddress.SocketNumber,
requestCount: CARDINAL ← 1, waitTime: OISCPTypes.WaitTime ← defaultWaitTime]
RETURNS [ExchangeHandle]; -- requestCount is estimate of number of "to be queued" requests
user must save rH inorder to send a reply
WaitForRequest: PROCEDURE [h: ExchangeHandle, requestBlk: Block,
requiredRequestType: OISCPTypes.ExchangeClientType ← unspecified]
RETURNS [rH: RequestHandle];
upon success return of SendReply, rH is invalid.
SendReply: PUBLIC PROCEDURE [h: ExchangeHandle, rH: RequestHandle, replyBlk: Block, replyType: OISCPTypes.ExchangeClientType ← unspecified];
request and reply can both point to the same piece of storage.
Delete: PROCEDURE [h: ExchangeHandle];
SetWaitTime: PROCEDURE [h: ExchangeHandle, waitTime: OISCPTypes.WaitTime];
END.\199b14B25i611I78i31I51i39I46i80I108i1I63i11I180i11I1i36bI5B27i1bI7B9i25t10 31bI15B12t0 50t10 9t0 14t10 1t0 1i24I1b12B246t10i16bI13B1i1I24t0 14t10 42t0 49t10 13t0 14t10 1t0 1i65I2i45bI14B162i52I3b9B144i69t10bI6B16t0 14t10 1t0 2t10b11B13t0 48t10 3t0
LOG
Time: October 23, 1980 1:50 PM By: Dalal Action: created file.
Time: January 13, 1981 5:01 PM By: BLyon Action: moved file to Pilot Communication.
\1i