예제 #1
0
        /// <summary>
        /// Bağlantı zamanlarını kontrol eder ve n süresinden uzun sinyal göndermeyen clientleri bulur ve bilgilendiriciye gönderir.
        /// </summary>
        public void CheckConnectionTimes()
        {
            var connectionLoseClients = _modifiedConnectionCredentials.Where(p => (DateTime.Now - p.LastReceivedSignalDateTime).Seconds > signalWarningTime);

            if (connectionLoseClients.Any())
            {
                var connectionLosesToInform = connectionLoseClients.ToArray();
                _notificator.Inform(connectionLosesToInform);

                for (int i = 0; i < connectionLoseClients.Count(); i++)
                {
                    _modifiedConnectionCredentials.Remove(connectionLoseClients.ElementAt(i));
                }
            }
        }