Brunet.Transport.EdgeListener.UpdateRemoteTAs C# (CSharp) 메소드

UpdateRemoteTAs() 공개 메소드

public UpdateRemoteTAs ( IList list, Edge e, TransportAddress ta ) : void
list IList
e Edge
ta TransportAddress
리턴 void
    public virtual void UpdateRemoteTAs(IList<TransportAddress> list, Edge e, TransportAddress ta) {
      if( e.TAType == this.TAType ) {
        if( e.RemoteTANotEphemeral ) {
          //There is some chance this will be good again in the future
          //But, we only keep non-natted TAs, since NAT mappings change
          //so frequently, a NATed TA will probably be bad in the future
          if( ta.Equals( e.RemoteTA ) ) {
            //This node is not behind a NAT.
            int idx = list.IndexOf(ta);
            if( idx >= 0 ) {
              list.Remove(ta);
            }
            //Now put the i
            list.Insert(0, ta);
          }
        }
      }
    }

Usage Example

예제 #1
0
        ///<summary>This is passed tothe underlying EdgeListener.  By default we do
        ///nothing to this.</summary>
        public override void UpdateRemoteTAs(IList <TransportAddress> list, Edge e, TransportAddress ta)
        {
            WrapperEdge edge = e as WrapperEdge;

            if (edge != null)
            {
                _el.UpdateRemoteTAs(list, edge.WrappedEdge, ta);
            }
        }
All Usage Examples Of Brunet.Transport.EdgeListener::UpdateRemoteTAs