Exemplo n.º 1
0
        /// <summary>
        /// Checks the timeout entrys for any that have expired.
        /// </summary>
        public void CheckTimeouts( )
        {
            lock (List.SyncRoot)
            {
                if (List.Count == 0)
                {
                    return;
                }

                for (int i = 0; i < List.Count; i++)
                {
                    TimeoutEntry toe = List[i] as TimeoutEntry;

                    if (toe == null)
                    {
                        continue;
                    }

                    if (toe.TimeoutTime < DateTime.Now)
                    {
                        m_Parent.ConnectionRequestTimedOut(toe.ServerIP, toe.ServerPort, toe.ConnectionRequestID);
                        List.Remove(toe);
                        return;
                    }
                }
            }
        }