示例#1
0
        protected override void EncodeRequestData(IChannel channel, IObjectOutput output, object data)
        {
            RpcInvocation inv = (RpcInvocation)data;

            output.WriteUTF(inv.GetAttachment(Constants.DubboVersionKey, DubboVersion));
            output.WriteUTF(inv.GetAttachment(Constants.PathKey));
            output.WriteUTF(inv.GetAttachment(Constants.VersionKey));
            //Console.WriteLine("encode attachment:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            output.WriteUTF(inv.MethodName);
            output.WriteUTF(ReflectUtil.GetDesc(inv.ParameterTypes));
            //Console.WriteLine("encode method and paramtype:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            object[]
            args = inv.Arguments;
            if (args != null)
            {
                foreach (var arg in args)
                {
                    output.WriteObject(arg);
                }
            }
            //Console.WriteLine("encode args:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            output.WriteObject(inv.Attachments);
            //Console.WriteLine("encode all attachments:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
        }