Exemple #1
0
        public void OnMsg(RouterStopMsg msg)
        {
            using (TimedLock.Lock(this.SyncRoot))
            {
                if (!isRunning)
                {
                    return;
                }

                base.PhysicalRoutes.Remove(msg.RouterEP);
                base.LogicalRoutes.Flush();
            }
        }
Exemple #2
0
        public void Msg_Clone_RouterStopMsg()
        {
            RouterStopMsg msgIn, msgOut;

            Msg.ClearTypes();
            Msg.LoadTypes(Assembly.GetExecutingAssembly());

            msgOut = new RouterStopMsg(MsgEP.Parse("physical://root.com:80/hub/leaf"));
            msgIn  = (RouterStopMsg)msgOut.Clone();

            Assert.AreEqual("physical://root.com:80/hub/leaf", msgIn.RouterEP.ToString());

            TestBaseCloning(msgOut);
        }
Exemple #3
0
        public void Msg_Serialize_RouterStopMsg()
        {
            RouterStopMsg  msgIn, msgOut;
            EnhancedStream es = new EnhancedMemoryStream();

            Msg.ClearTypes();
            Msg.LoadTypes(Assembly.GetExecutingAssembly());

            msgOut = new RouterStopMsg(MsgEP.Parse("physical://root.com:80/hub/leaf"));

            Msg.Save(es, msgOut);
            es.Seek(0, SeekOrigin.Begin);
            msgIn = (RouterStopMsg)Msg.Load(es);

            Assert.AreEqual("physical://root.com:80/hub/leaf", msgIn.RouterEP.ToString());
        }