public static T RunRpcAndGetReply <T>(RpcGenericRequestInfo requestInfo, string serverName, int timeoutInMSec) where T : class
        {
            RpcGenericReplyInfo replyInfo = null;

            ActiveMonitoringGenericRpcHelper.RunRpcOperation(serverName, timeoutInMSec, ActiveMonitoringRpcExceptionWrapper.Instance, delegate(ActiveMonitoringRpcClient rpcClient)
            {
                ExTraceGlobals.ActiveMonitoringRpcTracer.TraceDebug <string>(0L, "GenericRequest(): Now making GenericRequest RPC to server {0}.", serverName);
                return(rpcClient.GenericRequest(requestInfo, out replyInfo));
            });
            return(SerializationServices.Deserialize <T>(replyInfo.AttachedData));
        }
        public static void RunRpcOperation(string serverName, int timeoutMs, ActiveMonitoringRpcExceptionWrapper rpcExceptionWrapperInstance, ActiveMonitoringGenericRpcHelper.InternalRpcOperation rpcOperation)
        {
            RpcErrorExceptionInfo errorInfo = null;

            rpcExceptionWrapperInstance.ClientRetryableOperation(serverName, delegate
            {
                using (ActiveMonitoringRpcClient activeMonitoringRpcClient = ActiveMonitoringGenericRpcHelper.RpcClientFactory(serverName, timeoutMs))
                {
                    errorInfo = rpcOperation(activeMonitoringRpcClient);
                }
            });
            rpcExceptionWrapperInstance.ClientRethrowIfFailed(serverName, errorInfo);
        }