public RelayEdgeListener(Node node, IRelayOverlap ito, IForwarderSelectorFactory iasf)
        {
            _ito          = ito;
            _iasf         = iasf;
            _oco          = new OverlapConnectionOverlord(node);
            _node         = node;
            _running      = 0;
            _started      = 0;
            _id_to_tunnel = new Dictionary <int, RelayEdge>();
            _sync         = new object();

            TransportAddress ta        = new RelayTransportAddress(node.Address, new List <Address>());
            ArrayList        local_tas = new ArrayList(1);

            local_tas.Add(ta);
            _local_tas = local_tas;

            _node.DemuxHandler.GetTypeSource(PType.Protocol.Relaying).Subscribe(this, null);
            _node.ConnectionTable.ConnectionEvent    += ConnectionHandler;
            _node.ConnectionTable.DisconnectionEvent += DisconnectionHandler;

            ConnectionList cons = _node.ConnectionTable.GetConnections(ConnectionType.Structured);

            Interlocked.Exchange(ref _connections, cons);
            _node.Rpc.AddHandler("tunnel", this);
            _oco_trim_timer = Brunet.Util.FuzzyTimer.Instance.DoEvery(OcoTrim, _oco_trim_timeout, 0);
        }
    public TunnelEdgeListener(Node node, ITunnelOverlap ito, IForwarderSelectorFactory iasf)
    {
      _ito = ito;
      _iasf = iasf;
      _oco = new OverlapConnectionOverlord(node);
      _node = node;
      _running = 0;
      _started = 0;
      _id_to_tunnel = new Dictionary<int, TunnelEdge>();
      _sync = new object();

      TransportAddress ta = new TunnelTransportAddress(node.Address, new List<Address>());
      ArrayList local_tas = new ArrayList(1);
      local_tas.Add(ta);
      _local_tas = local_tas;

      _node.DemuxHandler.GetTypeSource(PType.Protocol.Tunneling).Subscribe(this, null);
      _node.ConnectionTable.ConnectionEvent += ConnectionHandler;
      _node.ConnectionTable.DisconnectionEvent += DisconnectionHandler;

      ConnectionList cons = _node.ConnectionTable.GetConnections(ConnectionType.Structured);
      Interlocked.Exchange(ref _connections, cons);
      _node.Rpc.AddHandler("tunnel", this);
      _oco_trim_timer = Brunet.Util.FuzzyTimer.Instance.DoEvery(OcoTrim, _oco_trim_timeout, 0);
    }