示例#1
0
        public void RemoveFromView(string subject)
        {
            if (!TSMan.ServerView.Contains(subject))
            {
                Console.WriteLine("Already removed ");
                return;
            }

            //Remove server from view
            TSMan.RemoveFromView(subject);

            if (!TSMan.ServerView.Contains(subject))
            {
                Console.WriteLine("Already removed");
                return;
            }

            //Remove server from view
            TSMan.RemoveFromView(subject);
            Console.WriteLine("Remove from view # 2 => " + (++removeCounter));

            //Remove from dead suspects
            lock (SuspectedDead)
            {
                if (SuspectedDead.ContainsKey(subject))
                {
                    SuspectedDead.Remove(subject);
                }
                Monitor.Pulse(SuspectedDead);
            }
        }
示例#2
0
        public void RemoveFromView(string url, string id, int seq)
        {
            //Update aggred sequence number of update view msg
            Message update = UpdateMessage(id, seq);

            //Remove server from view
            TSMan.RemoveFromView(url);

            //Remove from queue all messages from this process
            RemoveMessagesFrom(url);

            //Remove update view message from queue
            RemoveFromQueue(update);

            //Remove from dead suspects
            lock (SuspectedDead)
            {
                if (SuspectedDead.ContainsKey(url))
                {
                    SuspectedDead.Remove(url);
                }
                Monitor.Pulse(SuspectedDead);
            }
        }