DIRECTORY IO, RefID USING [ ID ], Rope USING [ROPE], RuntimeError USING [ UNCAUGHT ], SRPCCalls USING [ Conversation, Error, GetSHandle, Handle, NewRPCConversation, ReleaseConversation, ReportProc, SHandle, TimeoutEnable], Thrush, ThrushSunRPC, ThrushSunRPCConvert, LarkFeep, LarkFeepRpcControl, LarkFeepSunRPC, LarkFeepSunRPCClient, LarkFeepSunImport, VoiceUtils ; LarkFeepToLarkFeepSunRPC: CEDAR PROGRAM IMPORTS IO, LarkFeepSunRPCClient, RuntimeError, SRPCCalls, ThrushSunRPCConvert, VoiceUtils EXPORTS LarkFeepSunImport = { OPEN IO, ThrushSunRPCConvert; sunSHHH: CARD32 = 0; SHandle: TYPE ~ SRPCCalls.SHandle; InterfaceRecord: TYPE = LarkFeepRpcControl.InterfaceRecord; Feep: PROC [interface: InterfaceRecord, shhh: Thrush.SHHH, serviceID: RefID.ID, convID: Thrush.ConversationID, requestingParty: Thrush.PartyID, number: Rope.ROPE, noisy: BOOLEAN _ FALSE, on, off: CARDINAL_ 177777B] RETURNS [nb: Thrush.NB] = { ENABLE { SRPCCalls.Error => { nb _ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb _ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srNB _ LarkFeepSunRPCClient.Feep[h: GetHandle[shhh], shhh: sunSHHH, serviceID: serviceID, convID: ConvIDToSr[convID], requestingParty: requestingParty, number: ROPEToSr[number], noisy: noisy, on: on, off: off]; nb _ SrToATOM[srNB]; }; Flash: PROC [interface: InterfaceRecord, shhh: Thrush.SHHH, serviceID: RefID.ID, convID: Thrush.ConversationID, requestingParty: Thrush.PartyID, actionID: Thrush.ActionID, extraTime: CARDINAL_ 177777B] RETURNS [nb: Thrush.NB] = { ENABLE { SRPCCalls.Error => { nb _ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb _ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srNB _ LarkFeepSunRPCClient.Flash[h: GetHandle[shhh], shhh: sunSHHH, serviceID: serviceID, convID: ConvIDToSr[convID], requestingParty: requestingParty, actionID: actionID, extraTime: extraTime]; nb _ SrToATOM[srNB]; }; GetHandle: PROC[shhh: Thrush.SHHH] RETURNS [h: SRPCCalls.Handle] ~ { sHandle: SHandle; IF shhh = NIL THEN SRPCCalls.Error[$noConversationSupplied]; sHandle _ SRPCCalls.GetSHandle[shhh]; IF sHandle=NIL THEN SRPCCalls.Error[$invalidConversationSupplied]; h _ sHandle.handle; }; sunPgm: CARD _ 390914; -- decimal program number for VoiceRopeServer sunPgmVersion: CARD _ 1; sunCallTimeout: INT _ 3000; sunCallRetries: INT _ 3; sunCallTimeoutEnable: SRPCCalls.TimeoutEnable _ always; ImportInterface: PUBLIC PROC [instance: Rope.ROPE] RETURNS [interface: InterfaceRecord, shhh: Thrush.SHHH] ~ { shhh _ SRPCCalls.NewRPCConversation[serverName: instance, rpcProgram: sunPgm, rpcVersion: sunPgmVersion, timeoutEnable: sunCallTimeoutEnable, timeoutInMs: sunCallTimeout, retries: sunCallRetries, reportProc: ForwardReports]; SRPCCalls.GetSHandle[shhh].enabled _ TRUE; interface _ NEW[LarkFeepRpcControl.InterfaceRecordObject]; interface^ _ [clientStubFeep: Feep, clientStubFlash: Flash ]; }; UnImportInterface: PUBLIC PROC [shhh: Thrush.SHHH] ~ { SRPCCalls.ReleaseConversation[shhh]; }; ReportError: PROC[shhh: Thrush.SHHH, errCode: ATOM, explanation: Rope.ROPE_NIL] RETURNS[nb: Thrush.NB] ~ { sHandle: SHandle _ SRPCCalls.GetSHandle[shhh]; IF sHandle=NIL THEN RETURN; ForwardReports[sHandle, errCode, explanation]; nb _ $callFailed; }; ForwardReports: SRPCCalls.ReportProc ~ { VoiceUtils.ProblemFR[remark: "Lark Feep Failure, code: %g, expl: %g", where: $System, a1: atom[ec], a2: rope[expl]]; }; }.  LarkFeepToLarkFeepSunRPC.mesa Copyright ำ 1990 by Xerox Corporation. All rights reserved. Pier, May 24, 1990 12:47:50 pm PDT Swinehart, September 19, 1990 7:17:38 am PDT Polle Zellweger (PTZ) October 29, 1990 3:31:44 pm PST Procedures Handles Connecting instance should be a SunRPC address, in the form "sun#[1.2.3.4]#5", where [1.2.3.4] is the Arpa address, and 5 is the port. Polle Zellweger (PTZ) October 29, 1990 12:05:26 pm PST Allow detection of NIL ropes across a SunRPC connection. changes to: Feep สm•NewlineDelimiter ™šœ™Icode™