public void OnMsg(RouterStopMsg msg) { using (TimedLock.Lock(this.SyncRoot)) { if (!isRunning) { return; } base.PhysicalRoutes.Remove(msg.RouterEP); base.LogicalRoutes.Flush(); } }
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); }
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()); }