Protocols.Mesa
Copyright Ó 1992 by Xerox Corporation. All rights reserved.
Last Edited by: Spreitzer, February 19, 1986 9:50:07 pm PST
Last tweaked by Mike Spreitzer on April 4, 1990 12:22:28 pm PDT
Mike Spreitzer August 26, 1986 9:31:23 pm PDT
DIRECTORY IO, Rope;
Protocols: CEDAR DEFINITIONS = {
ROPE: TYPE = Rope.ROPE;
Protocol: TYPE = REF ProtocolRep;
ProtocolRep: TYPE = RECORD [
name: ROPE,
Instantiate: PROC [client: Client, logFileName: ROPE ¬ NIL] RETURNS [c: Conversant],
StartConnect: PROC [c: Conversant, serverName: ROPE, login: BOOL ¬ FALSE],
StartDisconnect: PROC [c: Conversant, verbosely: BOOL ¬ TRUE],
GiveUp: PROC [c: Conversant, verbosely: BOOL ¬ TRUE],
Aborts while connecting or disconnecting.
SetOnLine: PROC [c: Conversant, onLine: BOOL],
protocolData: REF ANY ¬ NIL
];
Client: TYPE = REF ClientPrivate;
ClientPrivate: TYPE = RECORD [
fromClient, toClient: IO.STREAM,
type: ClientType,
clientData: REF ANY ¬ NIL
];
ClientType: TYPE = REF ClientTypePrivate;
ClientTypePrivate: TYPE = RECORD [
NoteState: PROC [c: Conversant] ¬ NIL,
typeData: REF ANY ¬ NIL
];
Conversant: TYPE = REF ConversantPrivate;
ConversantPrivate: TYPE = RECORD [
protocol: Protocol,
client: Client,
state: State ¬ [FALSE, disconnected],
serverName: ROPE ¬ NIL,
driver: IO.STREAM ¬ NIL,
conversantData: REF ANY ¬ NIL
];
State: TYPE = RECORD [
onLine: BOOL,
connectivity: Connectivity
];
Connectivity: TYPE = {disconnected, connecting, connected, disconnecting};
GetProtocol: PROC [name: ROPE] RETURNS [p: Protocol];
RegProtocol: PROC [p: Protocol];
EnumerateProtocols: PROC [PROC [Protocol]];
}.