-- JoinAppServerImpl.mesa
-- Please do not edit this file.
-- It was generated using CedarRPCGen.
-- Theimer, February 11, 1993 4:20 pm PST

DIRECTORY
SunRPC,
SunRPCAuth,
Rope,
UT,
UTGetPut,
JoinAppGetPut,
JoinApp;

JoinAppServerImpl: CEDAR PROGRAM
IMPORTS SunRPC, UTGetPut, JoinAppGetPut
EXPORTS JoinApp =
BEGIN
ROPE: TYPE = Rope.ROPE;

Handle: TYPE = SunRPC.Handle;
Conversation: TYPE = SunRPCAuth.Conversation;

defaultReplyTTL: CARDINAL ← 10;

MakeJoinApp1Server: PUBLIC PROC[
data: REF,
servernoop: JoinApp.servernoopProc,
joinapplication: JoinApp.joinapplicationProc
] RETURNS [SunRPC.Server] ~ {

pseudoClient: JoinApp.JoinApp1 ~
 NEW[JoinApp.JoinApp1Object ← [
  rpcHandle ~ NIL, rpcConversation ~ NIL, data ~ data,
  servernoop ~ servernoop,
  joinapplication ~ joinapplication
 ]];

unbound: SunRPC.Server ~ NEW[SunRPC.ServerObject ← [
 pgm ~ JoinApp.JoinAppPrognum,
 version ~ JoinApp.version1,
 clientData ~ pseudoClient,
 serverProc ~ JoinApp1Handler
 ]];

RETURN [unbound];
};

JoinApp1Handler: SunRPC.ServerProc -- [h: Handle, c: Conversation, proc: CARD, clientData: REFANY
  -- RETURNS [doReply: BOOLEAN, replyTimeToLive: CARDINAL] -- = {
o: JoinApp.JoinApp1 ← NARROW[clientData];
doReply ← TRUE;
replyTimeToLive ← defaultReplyTTL;
SELECT proc FROM
0 => servernoop1[h, c, o];
1 => joinapplication1[h, c, o];
ENDCASE => ERROR SunRPC.Error[$wrongProc];
};

servernoop1: PROC[h: Handle, c: Conversation, o: JoinApp.JoinApp1] = {
o.servernoop[o];
SunRPC.StartReply[h];
};

joinapplication1: PROC[h: Handle, c: Conversation, o: JoinApp.JoinApp1] = {
in: UT.ObjectDescription;
out: JoinApp.JoinApplicationreturn;
in ← UTGetPut.GetObjectDescription[h];
out ← o.joinapplication[o,
   in];
SunRPC.StartReply[h];
JoinAppGetPut.PutJoinApplicationreturn[h, out];
};


END.