Beispiel #1
0
        static void DoRequestRouting(HttpApplication application, string workSessionID)
        {
            RoutingTable.EnsureServerIsPrepared();

            WorkSessionServerInfo serverInfo = RoutingTable.GetWorkSessionServerInfoByWorkSessionID(workSessionID);

            if (serverInfo != null && serverInfo.Status != WorkSessionServerStatus.Online)
            {
                throw new Exception("WorkSession is not available");
            }

            if (serverInfo == null && !HeaderCookieHelper.HasServerAffinity(application, RoutingConfiguration.AffinityCookieName))
            {
                serverInfo = RoutingTable.FindAvailableServerForNewWorkSession();
            }

            if (serverInfo != null && RoutingConfiguration.UseCookie)
            {
                FarmConfigurationManager.AddServer(serverInfo.HostServerIP, 8080);
                string newCookieValue = ARRHashHelper.CalculateHash(serverInfo.HostServerIP);
                HeaderCookieHelper.PatchHeaderCookieGUID(application, RoutingConfiguration.AffinityCookieName, newCookieValue);
            }
        }
        public bool PreccessRequest(HttpApplication application)
        {
            bool        handled          = false;
            HttpContext context          = application.Context;
            bool        requestToProcess = context.Request.FilePath.Contains("diagnostic.aspx");

            if (requestToProcess)
            {
                string content = DevExpress.Web.OfficeAzureCommunication.Diagnostic.WorkSessionServerView.CreateDianosticPageHtml(System.Environment.MachineName, address => ARRHashHelper.CalculateHash(address));
                context.Response.Write(content);
                context.Response.End();
                handled = true;
            }
            return(handled);
        }