Brunet.Symphony.DirectionalRouting.NextConnection C# (CSharp) Метод

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

public NextConnection ( Edge from, AHHeader h ) : bool>.Pair
from Edge
h AHHeader
Результат bool>.Pair
  public override Pair<Connection, bool> NextConnection(Edge from, AHHeader h) {
    DirectionalAddress dest = (DirectionalAddress)h.Destination;
    if( h.Ttl <= h.Hops ) {
      //Deliver it to us but stop it here:
      return _NULL_TRUE;
    }
    if ( dest.Bearing == DirectionalAddress.Direction.Left ) {
      if( h.Opts == AHHeader.Options.Path ) {
        return _LEFT_TRUE;    
      }
      else {
        return _LEFT_FALSE;
      }
    }
    else if (dest.Bearing == DirectionalAddress.Direction.Right) {
      if( h.Opts == AHHeader.Options.Path ) {
        return _RIGHT_TRUE;    
      }
      else {
        return _RIGHT_FALSE;
      }
    }
    else {
      throw new System.Exception(
          System.String.Format("Unrecognized direction: {0}", dest.Bearing));
    }
  }
}