public override bool OnStart() { ServicePointManager.DefaultConnectionLimit = 64; ServicePointManager.Expect100Continue = false; ServicePointManager.UseNagleAlgorithm = false; #region Launch silo in separate AppDomain var dataConnectionString = RoleEnvironment.GetConfigurationSettingValue("DataConnectionString"); var orleansSiloConfiguration = File.ReadAllText("OrleansConfiguration.xml").Replace( "XXXDataConnectionStringValueXXX", dataConnectionString); this.siloHost = new SiloHost(); this.siloHost.StartLobbyServiceSiloAppDomain(orleansSiloConfiguration); #endregion Trace.TraceInformation("LobbyServiceInstanceId " + this.SharedSettings.InstanceId); Trace.TraceInformation("Settings.IPEndPoint " + this.LobbyServiceSettings.IPEndPoint.ToString()); if (!OrleansAzureClient.IsInitialized) { OrleansAzureClient.Initialize("ClientConfiguration.xml"); } var server = new AsyncServerHost(this.LobbyServiceSettings.IPEndPoint); this.lobbyServerImpl = cc.GetExportedValue <LobbyServerImpl>(); this.lobbyTask = server.Start(lobbyServerImpl, cts.Token); return(true); }
static void InitializeOrleansClient() { var clientConfigFile = AzureConfigUtils.ClientConfigFileLocation; if (!clientConfigFile.Exists) { throw new FileNotFoundException(clientConfigFile.FullName); } OrleansAzureClient.Initialize(clientConfigFile); }
public static void EnsureOrleansClientInitialized() { if (!OrleansAzureClient.IsInitialized) { FileInfo clientConfigFile = AzureConfigUtils.ClientConfigFileLocation; if (!clientConfigFile.Exists) { throw new FileNotFoundException( string.Format("Cannot find Orleans client config file for initialization at {0}", clientConfigFile.FullName), clientConfigFile.FullName); } OrleansAzureClient.Initialize(clientConfigFile); } }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); // Orleans Client if (!OrleansAzureClient.IsInitialized) { OrleansAzureClient.Initialize(Server.MapPath(@"~/ClientConfiguration.xml")); } OrleansConfig.InitializeOrleans(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); if (RoleEnvironment.IsAvailable) { OrleansAzureClient.Initialize(Server.MapPath("~/AzureConfiguration.xml")); } else { Orleans.OrleansClient.Initialize(Server.MapPath("~/ClientConfiguration.xml")); } }
protected void Application_Start() { if (RoleEnvironment.IsAvailable) { // running in Azure OrleansAzureClient.Initialize(Server.MapPath(@"~/AzureConfiguration.xml")); } else { // not running in Azure OrleansClient.Initialize(Server.MapPath(@"~/LocalConfiguration.xml")); } AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); }
/// <summary> /// Configures Orleans for use with Azure. /// </summary> /// <remarks>This should appear earlier in the pipeline than any usage of Orleans.</remarks> /// <param name="app">The app being configured.</param> /// <param name="clientConfigurationFile">The client configuration file.</param> public static void ConfigureOrleans(this IAppBuilder app, FileInfo clientConfigurationFile) { app.Use( async(context, next) => { if (!OrleansAzureClient.IsInitialized) { lock (InitializationLock) { if (!OrleansAzureClient.IsInitialized) { OrleansAzureClient.Initialize(clientConfigurationFile); } } } await next.Invoke().ConfigureAwait(false); }); }
public ActionResult Index() { ViewBag.Title = "Adventure Terre"; if (!OrleansAzureClient.IsInitialized) { FileInfo clientConfigFile = AzureConfigUtils.ClientConfigFileLocation; if (!clientConfigFile.Exists) { var configFilePath = System.Web.Hosting.HostingEnvironment.MapPath("~/bin/") + "ClientConfiguration.xml"; OrleansAzureClient.Initialize(configFilePath); } else { OrleansAzureClient.Initialize(clientConfigFile); } } return(View()); }
void Application_Start(object sender, EventArgs e) { // Code that runs on application startup if (!OrleansAzureClient.IsInitialized) { FileInfo clientConfigFile = AzureConfigUtils.ClientConfigFileLocation; if (!clientConfigFile.Exists) { //throw new FileNotFoundException(string.Format("Cannot find Orleans client config file for initialization at {0}", clientConfigFile.FullName), clientConfigFile.FullName); var configFilePath = System.Web.Hosting.HostingEnvironment.MapPath("~/bin/") + "ClientConfiguration.xml"; OrleansAzureClient.Initialize(configFilePath); } else { OrleansAzureClient.Initialize(clientConfigFile); } } AreaRegistration.RegisterAllAreas(); System.Web.Http.GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); }