Ejemplo n.º 1
0
 void IClient.Push(MethodReturnArgs args)
 {
     lock (mPool)
     {
         mPool.Push(args);
     }
 }
Ejemplo n.º 2
0
 void IClient.RegisterRemote(long id, MethodReturnArgs e)
 {
     lock (mRemotingMethods)
     {
         mRemotingMethods[id] = e;
     }
 }
Ejemplo n.º 3
0
        MethodReturnArgs IClient.Pop()
        {
            MethodReturnArgs result;

            lock (mPool)
            {
                if (mPool.Count > 0)
                {
                    result = mPool.Pop();
                    result.Reset();
                }
                result = new MethodReturnArgs();
                return(result);
            }
        }
Ejemplo n.º 4
0
 private void OnReceive(object sender, PackageReceiveArgs e)
 {
     lock (this)
     {
         if (e.Message is Remoting.RPC.MethodResult)
         {
             Remoting.RPC.MethodResult result = (Remoting.RPC.MethodResult)e.Message;
             if (mRemotingMethods.TryGetValue(result.ID, out mMethodReturnArgs))
             {
                 mMethodReturnArgs.Import(result);
             }
         }
         else
         {
             if (mMethodReturnArgs == null)
             {
                 if (Receive != null)
                 {
                     Receive(sender, e);
                 }
             }
             else
             {
                 if (mMethodReturnArgs.Status == InvokeStatus.Return)
                 {
                     mMethodReturnArgs.SetReturn(e.Message);
                 }
                 else if (mMethodReturnArgs.Status == InvokeStatus.Parameter)
                 {
                     mMethodReturnArgs.AddParameter(e.Message);
                 }
             }
         }
         if (mMethodReturnArgs != null && mMethodReturnArgs.Status == InvokeStatus.Completed)
         {
             mMethodReturnArgs.Completed();
             mMethodReturnArgs = null;
         }
     }
 }