EFTP.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Hal Murray, March 13, 1986 2:38:30 am PST
DIRECTORY
Rope USING [ROPE],
Pup USING [Address];
EFTP:
CEDAR
DEFINITIONS = {
Handle: TYPE = REF Object;
Object: TYPE;
Milliseconds: TYPE = INT;
Create/Delete
CreateSender: PROC [him: Pup.Address, waitForAck: BOOL ← TRUE] RETURNS [Handle];
CreateReceiver: PROC [me: Pup.Address] RETURNS [Handle];
GetHisAddress: PROC [Handle] RETURNS [Pup.Address];
Abort: PROC [Handle, Rope.ROPE];
Finish: PROC [Handle];
Sending
SetSendTimeout: PROC [handle: Handle, milliseconds: Milliseconds, tries: NAT];
PutBlock:
PROC [Handle,
REF
TEXT];
Must fit into a single buffer and/or through gateways.
Receiving
SetRecvTimeout: PROC [handle: Handle, milliseconds: Milliseconds];
GetBlock:
PROC [Handle,
REF
TEXT];
Must be big enough for a whole packet. No new data => EOF.
Errors
BlockTooBig: ERROR;
InvalidCallSequence: ERROR; -- User error
Timeout: SIGNAL; -- RESUME to keep trying
Trouble: ERROR [code: AbortCode, err: Rope.ROPE];
AbortCode:
TYPE =
MACHINE
DEPENDENT {
ok(0), -- pseudo code
externalSenderAbort(1),
externalReceiverAbort(2),
receiverBusyAbort(3),
outOfSyncAbort(4),
rejected(1001) -- pseudo code
};
}.