Exemplo n.º 1
0
        public bool RemoteCall(string Method, byte[] Args)
        {
            UInt64 hash = FNV1a.Hash(Method);

            byte[] buf;
            int    hedrlen;
            int    argslen = Args == null ? 0 : Args.Length;

            buf     = new byte[m_hedrsize + argslen];
            hedrlen = NetStruct.PackFmtBuffer(buf, 0, "li", unchecked ((Int64)hash), argslen);

            if (hedrlen != m_hedrsize)
            {
                Console.WriteLine($"RemoteClient.RemoteCall() internal error");
                return(false);
            }

            if (argslen > 0)
            {
                Array.Copy(Args, 0, buf, hedrlen, argslen);
            }

            m_calls.Add(buf);
            return(true);
        }
Exemplo n.º 2
0
 public RemoteMethod Find(string Str)
 {
     return(FindHash(FNV1a.Hash(Str)));
 }
Exemplo n.º 3
0
 public RemoteMethod(string Name, Func <RemoteClient, byte[], bool> Method)
 {
     m_name = Name;
     m_hash = FNV1a.Hash(Name);
     m_meth = Method;
 }