コード例 #1
0
        public RpcCallResultMessage CreateCallResultMessage(ITransportChannel channel, IRpcObjectRepository localRepository,
                                                            RpcMethodCallMessage call, MethodInfo calledMethod, object result)
        {
            var resultArgument = CreateRpcArgument(channel, localRepository, result, calledMethod.ReturnType);
            var resultMessage  = new RpcCallResultMessage
            {
                CallId = call.CallId,
                Type   = RpcMessageType.CallMethodResult,
                Result = resultArgument
            };

            return(resultMessage);
        }
コード例 #2
0
 public object DecodeRpcCallResultMessage(IRpcChannel channel, IRpcObjectRepository localRepository,
                                          IRpcObjectRepository remoteRepository, IRpcSerializer serializer, RpcCallResultMessage message, Type resultType)
 {
     if (message.Type == RpcMessageType.Exception)
     {
         throw new TargetInvocationException((Exception)message.Result.Value);
     }
     return(DecodeRpcArgument(channel, localRepository, remoteRepository, serializer, message.Result, resultType));
 }