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); } } }
/// <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); }
internal override void Send(RpcMessage message) { lock (mQueuedMessagesLock) mQueuedMessages.Enqueue(message); }
internal abstract void Send(RpcMessage message);