Example #1
0
        private Response HandleEvent(Request req)
        {
            Response res = RequestToResponse(req);
            Message  m   = new Message(res, new BinaryMessageFormatter());

            Queues.Get(res.Request.ClientID).Send(m);
            return(res);
        }
Example #2
0
        private Response ReceiveResponse(Request req)
        {
            MessageQueue q = Queues.Get(req.ClientID);

            q.Purge();
            while (true)
            {
                if (CanReceive(q, req))
                {
                    return((Response)q.Receive().Body);
                }
            }
        }
Example #3
0
        private void MessagePump()
        {
            MessageQueue q = Queues.Get(ServerID);

            q.Purge();
            while (true)
            {
                if (CanHandleEvent(q))
                {
                    Response res = HandleEvent((Request)q.Receive().Body);
                    if ("Server.Kill" == res.Request.Method)
                    {
                        break;
                    }
                }
            }
        }
Example #4
0
        private void SendRequest(Request req)
        {
            Message m = new Message(req, new BinaryMessageFormatter());

            Queues.Get(req.ServerID).Send(m);
        }