Example #1
0
        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)); }
        }
Example #2
0
        static public ServerStub GetStub(int stubID)
        {
            ServerStub ret = null;

            lock (stubs) {
                ret = (ServerStub)stubs.Get(stubID);
            }
            return(ret);
        }