MulticastImportImpl.Mesa
Copyright Ó 1985, 1987 by Xerox Corporation. All rights reserved.
Last modified by Swinehart, April 3, 1987 9:11:40 am PST
DIRECTORY
Commander USING [ CommandProc, Register ],
CommandTool USING [ NextArgument ],
NameDB USING [ GetAttribute ],
MulticastImp,
MulticastRpcControl USING [ ImportInterface ],
IO,
RPC USING [ ImportFailed, ShortROPE ],
VoiceUtils USING [ MakeRName, NetAddress, NetAddressFromRope, Problem, Report, ReportFR ]
;
MulticastImportImpl: CEDAR PROGRAM
IMPORTS Commander, CommandTool, IO, VoiceUtils, RPC, NameDB, MulticastRpcControl
EXPORTS MulticastImp = {
OPEN IO;
Data
ROPE: TYPE= RPC.ShortROPE;
Import Procedure
MulticastImport: PUBLIC PROC [instance: ROPE] RETURNS [success: BOOLFALSE] = {
ENABLE RPC.ImportFailed => GOTO Failed;
hostHint: VoiceUtils.NetAddress;
IF instance=NIL THEN GOTO Failed; -- no defaulting.
instance ← VoiceUtils.MakeRName[instance, rName];
hostHint ← VoiceUtils.NetAddressFromRope[NameDB.GetAttribute[instance,$connect]];
MulticastRpcControl.ImportInterface [
interfaceName: [
type: "Multicast.Lark",
instance: instance
],
hostHint: hostHint];
success ← TRUE;
EXITS
Failed => VoiceUtils.Problem["Couldn't import Multicast.Lark", $System];
};
User command
CmdMulticastImport: Commander.CommandProc = {
instance: ROPE = CommandTool.NextArgument[cmd];
IF instance=NIL THEN {
VoiceUtils.Report["Usage: MulticastImport <serverInstance>", $System]; RETURN; };
IF MulticastImport[instance] THEN
VoiceUtils.ReportFR["ImportInterface[Multicast.Lark, %s]", $System, NIL, rope[instance]];
};
Initialization
Commander.Register["MulticastImport", CmdMulticastImport,
"MulticastImport <serverInstance[Michaelson]>\nConnects to multicast forwarding server"];
}.
Swinehart, May 14, 1985 12:59:49 pm PDT
Cedar 6.0
Swinehart, April 3, 1987 9:11:30 am PST
Convert to Cedar 7, accommodate NameDB
changes to: DIRECTORY, MulticastImportImpl, MulticastImport