Brunet.Tunnel.TunnelEdgeListener.ConnectionHandler C# (CSharp) 메소드

ConnectionHandler() 보호된 메소드

We need to keep track of a current ConnectionList, so we listen to incoming connections. We also use this opportunity to rebuild our LocalTA.
protected ConnectionHandler ( object o, EventArgs ea ) : void
o object
ea System.EventArgs
리턴 void
    protected void ConnectionHandler(object o, EventArgs ea)
    {
      ConnectionEventArgs cea = ea as ConnectionEventArgs;
      if(cea.ConnectionType != ConnectionType.Structured) {
        return;
      }

      ConnectionList cons = cea.CList;
      Interlocked.Exchange(ref _connections, cons);

      IList addresses = GetNearest(_node.Address, cons);
      TransportAddress ta = new TunnelTransportAddress(_node.Address, addresses);

      ArrayList tas = new ArrayList(1);
      tas.Add(ta);

      Interlocked.Exchange(ref _local_tas, tas);

      foreach(TunnelEdge te in _tunnels) {
        IDictionary sync_message = _ito.GetSyncMessage(te.Overlap, _node.Address, cons);
        Channel chan = new Channel(1);
        _node.Rpc.Invoke(te, chan, "tunnel.Sync", sync_message);
      }
    }