Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 2
0
 /// <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);
 }
Exemplo n.º 3
0
 internal override void Send(RpcMessage message)
 {
     lock (mQueuedMessagesLock)
         mQueuedMessages.Enqueue(message);
 }
Exemplo n.º 4
0
 internal abstract void Send(RpcMessage message);