/** creates a new outgoing Edge using the pathing protocol */ public override void CreateEdgeTo(TransportAddress ta, EdgeListener.EdgeCreationCallback ecb) { if (!IsStarted) { throw new EdgeException("PathEdgeListener is not started"); } string rempath; TransportAddress base_ta = PathELManager.SplitPath(ta, out rempath); if (_path == PathELManager.Root && rempath == PathELManager.Root) { /* * This is "normal" case, and we can skip all this stuff */ _el.CreateEdgeTo(ta, ecb); } else { CreateState cs = new CreateState(this, rempath, _path, ecb); /* * Make the underlying Edge: */ _el.CreateEdgeTo(base_ta, cs.HandleEC); } }
public CreateState(PathEdgeListener pel, string rem, string loc, EdgeListener.EdgeCreationCallback ecb) { _pel = pel; RemotePath = rem; LocalPath = loc; ECB = ecb; }
public EdgeCreationWrapper(TransportAddress ta, EdgeListener.EdgeCreationCallback ecb, Edge edge, WrapperEdgeListener parent) { ExternalECB = ecb; TA = ta; Parent = parent; _edge = edge; _called = 0; }
/** * This creates Edges of a given type */ public void CreateEdgeTo(TransportAddress destination, EdgeListener.EdgeCreationCallback ecb) { TransportAddress.TAType t = destination.TransportAddressType; if (_el_map.Contains(t)) { EdgeListener el = (EdgeListener)_el_map[t]; el.CreateEdgeTo(destination, ecb); } else { ecb(false, null, new EdgeException("No EdgeListener for TA type: " + t.ToString())); } }
/** creates a new outgoing Edge using the pathing protocol */ public override void CreateEdgeTo(TransportAddress ta, EdgeListener.EdgeCreationCallback ecb) { if (!IsStarted) { throw new EdgeException("PathEdgeListener is not started"); } string rempath; TransportAddress base_ta = PathELManager.SplitPath(ta, out rempath); bool root = false; if (_path == PathELManager.Root && rempath == PathELManager.Root) { root = true; } CreateState cs = new CreateState(this, rempath, _path, ecb, root); _el.CreateEdgeTo(base_ta, cs.HandleEC); }