示例#1
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);
                }
            }
        }
示例#2
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;
                    }
                }
            }
        }
示例#3
0
        private void SendRequest(Request req)
        {
            Message m = new Message(req, new BinaryMessageFormatter());

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