Пример #1
0
        public ClientProcessor()
        {
            _infoReserve = new InfoReserve
            {
                Created   = DateTime.Now,
                ExecStats = new List <MethodExecutionInfo>()
            };

            var heartbeatFlushIntervalSeconds = ConfigurationManager.AppSettings["HeartbeatFlushIntervalSeconds"];

            int heartbeatIntervalSeconds;

            if (string.IsNullOrEmpty(heartbeatFlushIntervalSeconds) ||
                !int.TryParse(heartbeatFlushIntervalSeconds, out heartbeatIntervalSeconds))
            {
                Console.WriteLine("HeartBeatFlushIntervalSeconds parameter is invalid in Configuration. The value is set to 60 sec.");
                heartbeatIntervalSeconds = 60;
            }

            LocalIp = GetLocalIpAddress();

            _flushTimer = new Timer
            {
                Interval = heartbeatIntervalSeconds * 1000
            };
            _flushTimer.Elapsed += _flushTimer_Elapsed;
            _flushTimer.Start();
        }
Пример #2
0
        public ClientProcessor()
        {
            _infoReserve = new InfoReserve
            {
                Created = DateTime.Now,
                ExecStats = new List<MethodExecutionInfo>()
            };

            var heartbeatFlushIntervalSeconds = ConfigurationManager.AppSettings["HeartbeatFlushIntervalSeconds"];

            int heartbeatIntervalSeconds;
            if (string.IsNullOrEmpty(heartbeatFlushIntervalSeconds) ||
                !int.TryParse(heartbeatFlushIntervalSeconds, out heartbeatIntervalSeconds))
            {
                Console.WriteLine("HeartBeatFlushIntervalSeconds parameter is invalid in Configuration. The value is set to 60 sec.");
                heartbeatIntervalSeconds = 60;
            }

            LocalIp = GetLocalIpAddress();

            _flushTimer = new Timer
            {
                Interval = heartbeatIntervalSeconds * 1000
            };
            _flushTimer.Elapsed += _flushTimer_Elapsed;
            _flushTimer.Start();
        }