Ejemplo n.º 1
0
        public void InitializeHttpCommand()
        {
            // start http client
            HttpWebClient <HttpCommand> httpClient = new HttpWebClient <HttpCommand>();

            try
            {
                int idleTime         = 1;
                int connectionLimit  = Int32.Parse(ConfigurationManager.AppSettings["OsoFx.RobotConnectionLimit"]);
                int maxServicePoints = Int32.Parse(ConfigurationManager.AppSettings["OsoFx.RobotMaxServicePoints"]);
                httpClient.SetServicePointSettings(connectionLimit, idleTime * 60 * 1000, maxServicePoints);
            }
            catch
            {
                httpClient.SetServicePointSettings(30, 2 * 60 * 1000, 15);
            }

            this.SetHttpClient(httpClient);

            try
            {
                this.KeepAlive = bool.Parse(ConfigurationManager.AppSettings["OsoFx.RobotKeepAlive"]);
            }
            catch
            {
                this.KeepAlive = false;
            }

            NavigationConfiguration config =
                (NavigationConfiguration)ConfigurationManager.GetSection("OsoFx.NavigationSteps");



            foreach (var step in config.NavigationSteps.Cast <HttpNavigationStep>())
            {
                // load links
                Navigation.AddLast(step);
            }
        }