示例#1
0
        /** 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);
            }
        }
示例#2
0
 public CreateState(PathEdgeListener pel, string rem, string loc,
                    EdgeListener.EdgeCreationCallback ecb)
 {
     _pel       = pel;
     RemotePath = rem;
     LocalPath  = loc;
     ECB        = ecb;
 }
示例#3
0
 public EdgeCreationWrapper(TransportAddress ta, EdgeListener.EdgeCreationCallback ecb,
                            Edge edge, WrapperEdgeListener parent)
 {
     ExternalECB = ecb;
     TA          = ta;
     Parent      = parent;
     _edge       = edge;
     _called     = 0;
 }
示例#4
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()));
     }
 }
示例#5
0
        /** 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);
        }
示例#6
0
 public CreateState(PathEdgeListener pel, string rem, string loc,
                    EdgeListener.EdgeCreationCallback ecb) {
   _pel = pel;
   RemotePath = rem;
   LocalPath = loc;
   ECB = ecb;
 }
示例#7
0
 public EdgeCreationWrapper(TransportAddress ta, EdgeListener.EdgeCreationCallback ecb,
     Edge edge, WrapperEdgeListener parent)
 {
   ExternalECB = ecb;
   TA = ta;
   Parent = parent;
   _edge = edge;
   _called = 0;
 }