public RouterLink(Router router1, Router router2) { //Router1 = router1; //Router2 = router2; //// left = new RouterLinkEnd(this, router1, router2.Id); right = new RouterLinkEnd(this, router2, router1.Id); //Router1.AddLinkEnd(left); //Router2.AddLinkEnd(right); //// //Router1.AddLink(Router2.Id, this); //Router2.AddLink(Router1.Id, this); // left.UpdateRoutes(router2.GetAllRoutes(), true); right.UpdateRoutes(router1.GetAllRoutes(), true); //Router1.UpdateRoutes(Router2.Id, Router2.GetAllRoutes(), true); //Router2.UpdateRoutes(Router1.Id, Router1.GetAllRoutes(), true); //// propagate to all sides //Router1.PropagateRoutes(""); //Router2.PropagateRoutes(""); left.PropagateRoutes(null); right.PropagateRoutes(null); }
public void AddLinkEnd(RouterLinkEnd linkEnd) { lock (locker) { linkEnds[linkEnd.RemoteId] = linkEnd; linkEnd.RegisterProcessMessage(ProcessMessage); UpdateRoute(linkEnd.RemoteId, linkEnd.RemoteId, 1); } }
public void PropagateRoutesExt(RouterLinkEnd linkEnd, Dictionary <string, int> allRoutes) { if (linkEnd == left) { right.UpdateRoutes(allRoutes); } else if (linkEnd == right) { left.UpdateRoutes(allRoutes); } }