private Response RequestToResponse(Request req) { ServerStub s = ServerStub.GetStub((int)req.Args.Get("stubID")); try { return((null == s) ? new Response(req, "Unhandled request") : (s.Call(req) ?? new Response(req, "Handled but returned null"))); } catch (Exception e) { return(new Response(req, "Error: " + e.Message)); } }
static public ServerStub GetStub(int stubID) { ServerStub ret = null; lock (stubs) { ret = (ServerStub)stubs.Get(stubID); } return(ret); }