コード例 #1
0
        public void InvokeMethod(object service, string methodName, List <RpcMessage.Parameter> parameters, RpcMessage resultMessage)
        {
            RpcMethodDescriptor method = GetMethod(methodName);

            if (method != null)
            {
                method.Invoke(service, parameters, resultMessage);
            }
            else
            {
                //return an error message to the client if it is expecting a result, otherwise we fail silently
                if (resultMessage != null)
                {
                    resultMessage.ResultMessage.IsFailed     = true;
                    resultMessage.ResultMessage.ErrorMessage = String.Format("Unknown method '{1}' in service '{0}'",
                                                                             Name, methodName);
                }
            }
        }
コード例 #2
0
ファイル: RpcChannel.cs プロジェクト: Mokarski/Vagonka
 /// <summary>
 /// Handles a message which has been received. Can be called by multiple threads concurrently, it is up to the
 /// RpcClient and RpcServer to ensure they are thread-safe.
 /// </summary>
 /// <returns></returns>
 protected void Receive(RpcMessage message)
 {
     mController.Receive(message);
 }
コード例 #3
0
 internal override void Send(RpcMessage message)
 {
     lock (mQueuedMessagesLock)
         mQueuedMessages.Enqueue(message);
 }
コード例 #4
0
ファイル: RpcChannel.cs プロジェクト: Mokarski/Vagonka
 internal abstract void Send(RpcMessage message);