本文整理汇总了C#中ClientConfiguration.CheckGatewayProviderSettings方法的典型用法代码示例。如果您正苦于以下问题:C# ClientConfiguration.CheckGatewayProviderSettings方法的具体用法?C# ClientConfiguration.CheckGatewayProviderSettings怎么用?C# ClientConfiguration.CheckGatewayProviderSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClientConfiguration
的用法示例。
在下文中一共展示了ClientConfiguration.CheckGatewayProviderSettings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClientConfig_Programatic
public void ClientConfig_Programatic()
{
string deploymentId = "ClientConfig_Programatic";
var config = new ClientConfiguration();
config.DeploymentId = deploymentId;
config.DataConnectionString = StorageTestConstants.DataConnectionString;
config.GatewayProvider = ClientConfiguration.GatewayProviderType.AzureTable;
config.PreferedGatewayIndex = 11;
output.WriteLine(config);
Assert.AreEqual(null, config.SourceFile, "SourceFile should be blank for programmatic config");
Assert.AreEqual(11, config.PreferedGatewayIndex, "PreferedGatewayIndex picked up from config object");
config.CheckGatewayProviderSettings();
}
示例2: OutsideRuntimeClient
public OutsideRuntimeClient(ClientConfiguration cfg, GrainFactory grainFactory, bool secondary = false)
{
this.grainFactory = grainFactory;
this.clientId = GrainId.NewClientId();
if (cfg == null)
{
Console.WriteLine("An attempt to create an OutsideRuntimeClient with null ClientConfiguration object.");
throw new ArgumentException("OutsideRuntimeClient was attempted to be created with null ClientConfiguration object.", "cfg");
}
this.config = cfg;
if (!TraceLogger.IsInitialized) TraceLogger.Initialize(config);
StatisticsCollector.Initialize(config);
SerializationManager.Initialize(config.UseStandardSerializer, cfg.SerializationProviders, config.UseJsonFallbackSerializer);
logger = TraceLogger.GetLogger("OutsideRuntimeClient", TraceLogger.LoggerType.Runtime);
appLogger = TraceLogger.GetLogger("Application", TraceLogger.LoggerType.Application);
try
{
LoadAdditionalAssemblies();
PlacementStrategy.Initialize();
callbacks = new ConcurrentDictionary<CorrelationId, CallbackData>();
localObjects = new ConcurrentDictionary<GuidId, LocalObjectData>();
if (!secondary)
{
UnobservedExceptionsHandlerClass.SetUnobservedExceptionHandler(UnhandledException);
}
// Ensure SerializationManager static constructor is called before AssemblyLoad event is invoked
SerializationManager.GetDeserializer(typeof(String));
clientProviderRuntime = new ClientProviderRuntime(grainFactory, new DefaultServiceProvider());
statisticsProviderManager = new StatisticsProviderManager("Statistics", clientProviderRuntime);
var statsProviderName = statisticsProviderManager.LoadProvider(config.ProviderConfigurations)
.WaitForResultWithThrow(initTimeout);
if (statsProviderName != null)
{
config.StatisticsProviderName = statsProviderName;
}
responseTimeout = Debugger.IsAttached ? Constants.DEFAULT_RESPONSE_TIMEOUT : config.ResponseTimeout;
BufferPool.InitGlobalBufferPool(config);
var localAddress = ClusterConfiguration.GetLocalIPAddress(config.PreferredFamily, config.NetInterface);
// Client init / sign-on message
logger.Info(ErrorCode.ClientInitializing, string.Format(
"{0} Initializing OutsideRuntimeClient on {1} at {2} Client Id = {3} {0}",
BARS, config.DNSHostName, localAddress, clientId));
string startMsg = string.Format("{0} Starting OutsideRuntimeClient with runtime Version='{1}'", BARS, RuntimeVersion.Current);
startMsg = string.Format("{0} Config= " + Environment.NewLine + " {1}", startMsg, config);
logger.Info(ErrorCode.ClientStarting, startMsg);
if (TestOnlyThrowExceptionDuringInit)
{
throw new Exception("TestOnlyThrowExceptionDuringInit");
}
config.CheckGatewayProviderSettings();
var generation = -SiloAddress.AllocateNewGeneration(); // Client generations are negative
var gatewayListProvider = GatewayProviderFactory.CreateGatewayListProvider(config)
.WithTimeout(initTimeout).Result;
transport = new ProxiedMessageCenter(config, localAddress, generation, clientId, gatewayListProvider);
if (StatisticsCollector.CollectThreadTimeTrackingStats)
{
incomingMessagesThreadTimeTracking = new ThreadTrackingStatistic("ClientReceiver");
}
}
catch (Exception exc)
{
if (logger != null) logger.Error(ErrorCode.Runtime_Error_100319, "OutsideRuntimeClient constructor failed.", exc);
ConstructorReset();
throw;
}
}