示例#1
0
文件: SendData.cs 项目: lipogem/lrpc
        /// <summary>
        /// added length data
        /// </summary>
        public byte[] ToArray()
        {
            ByteQue que = new ByteQue();

            que.PushSize(buff.Len);
            que.AddAll(buff.ToArray(), 0, -1);
            return(que.ToArray());
        }
示例#2
0
文件: Fun.cs 项目: MechWipf/lrpc
        /// <summary>
        /// call the method serialized into a queue
        /// </summary>
        /// <param name="name">the name of the calling method</param>
        /// <param name="args">calling method parameters</param>
        /// <returns>the result of calling the method</returns>
        public static ByteQue Make(string name, params object[] args)
        {
            ByteQue que = new ByteQue();

            byte[] arr = Encoding.UTF8.GetBytes((string)name);
            que.PushSize(arr.Length);
            foreach (byte ch in arr)
            {
                que.Push(ch);
            }
            foreach (object arg in args)
            {
                que.Push(arg.GetType(), arg);
            }
            return(que);
        }