public void Invoke(string methodId, IPeer peer, ResponseCallback responseCallback, params object[] objects)
 {
     Ssci.Invoke(methodId, peer, responseCallback, (serializable) => {
         foreach (var item in objects)
         {
             serializable.SerializableObject(item);
         }
     });
 }
Esempio n. 2
0
        public void Invoke <T>(Func <Expression <Action <T> > > func, ResponseCallback responseCallback)
        {
            var methodTuple = RpcRequestManager.CreateMethodTuple(func);
            var methodId    = methodTuple.RpcMethod.GetId();

            if (!Connections.TryGetValue(methodId, out var peer))
            {
                Logger.Warn($"服务器端没有注册{methodId}方法!");
                return;
            }

            Ssci.Invoke(func, peer, responseCallback);
        }
        public void Invoke(string methodId, IPeer peer, dynamic func, dynamic[] objects)
        {
            if (string.IsNullOrEmpty(methodId))
            {
                throw new ArgumentException(nameof(methodId));
            }

            if (peer == null)
            {
                throw new ArgumentNullException(nameof(peer));
            }

            ResponseCallback responseCallback = (rm, sd) => {
                func?.Invoke(rm, sd);
            };

            Ssci.Invoke(methodId, peer, responseCallback, PacketShell(objects));
        }
Esempio n. 4
0
        public void TestRpcService()
        {
            PoolAllocator <IWriteStream> .SetPool((arguments => new WriteStream()));

            Ssci.Invoke <ITest>(() => (rpc) => rpc.Test(200), null, null);
        }
Esempio n. 5
0
 public static void Invoke(string methodId, IPeer peer, ResponseCallback responseCallback, Action <ISerializable> action)
 {
     Ssci.Invoke(methodId, peer, responseCallback, action);
 }
Esempio n. 6
0
 public void Invoke <T>(Func <Expression <Action <T> > > func, IPeer peer, ResponseCallback responseCallback)
 {
     Ssci.Invoke(func, peer, responseCallback);
 }