static string GetDiscoveryType()

in gateway/Program.cs [164:198]


        static string GetDiscoveryType()
        {
            var hostNameType = Uri.CheckHostName(fabricNodeIpOrFQDN);
            switch (hostNameType)
            {
                case UriHostNameType.IPv4:
                case UriHostNameType.IPv6:
                    return DiscoveryType_Static;

                case UriHostNameType.Dns:
                    if (GetHostEntry(fabricNodeIpOrFQDN) == null)
                    {
                        var hostname = GetDNSResolveableHostName(fabricNodeIpOrFQDN);
                        if (hostname != null)
                        {
                            fabricNodeIpOrFQDN = hostname;
                            return DiscoveryType_LogicalDns;
                        }
                    }

                    // Cannot use DNS
                    // Let's try and check if we can reach the end point on one of the
                    // network's Default Gateway IPs
                    var ipAddress = GetReachableIPAddress();
                    if (ipAddress != null)
                    {
                        fabricNodeIpOrFQDN = ipAddress;
                        return DiscoveryType_Static;
                    }
                    return DiscoveryType_LogicalDns;

                default:
                    return String.Empty;
            }
        }