Brunet.Simulator.Transport.SimulationEdgeListener.Start C# (CSharp) Метод

Start() публичный Метод

public Start ( ) : void
Результат void
    public override void Start()
    {
      if(_is_started) {
        throw new Exception("Can only call SimulationEdgeListener.Start() once!"); 
      }

      var el_map = GetEdgeListenerList(_ta_type);
      if(el_map.ContainsKey(LocalID)) {
        throw new Exception("SimulationEdgeListener already exists: " + LocalID);
      }
      _is_started = true;
      el_map[LocalID] = this;
    }

Usage Example

Пример #1
0
        static public Node AddNode(Simulator sim, NatTypes type0, NatTypes type1, bool relay)
        {
            Node node = sim.AddNode();

            NatFactory.AddNat(node.EdgeListenerList, type0);

            if (relay)
            {
                Relay.IRelayOverlap ito = new Relay.SimpleRelayOverlap();
                EdgeListener        el  = new Relay.RelayEdgeListener(node, ito);
                node.AddEdgeListener(el);
                el.Start();
            }

            if (type1 != NatTypes.Disabled)
            {
                NodeMapping            nm  = sim.Nodes[node.Address];
                int                    id  = nm.ID;
                string                 tas = SimulationTransportAddress.GetString(TransportAddress.TAType.SO, id);
                INat                   nat = GetNat(TransportAddressFactory.CreateInstance(tas), type1);
                SimulationEdgeListener el  = new SimulationEdgeListener(id, 0, null,
                                                                        true, TransportAddress.TAType.SO, nat);
                node.AddEdgeListener(el);
                el.Start();
            }
            return(node);
        }