Amazon.Util.AWSPublicIpAddressRanges.Load C# (CSharp) Метод

Load() публичный статический Метод

Downloads the most recent copy of the endpoint address file and parses it to a collection of address range objects.
public static Load ( ) : AWSPublicIpAddressRanges
Результат AWSPublicIpAddressRanges
        public static AWSPublicIpAddressRanges Load()
        {
            const int maxDownloadRetries = 3;

            var retries = 0;
            while (retries < maxDownloadRetries)
            {
                try
                {
                    var content = AWSSDKUtils.DownloadStringContent(IpAddressRangeEndpoint);
                    AWSPublicIpAddressRanges instance = Parse(content);

                    return instance;
                }
                catch (Exception e)
                {
                    retries++;
                    if (retries == maxDownloadRetries)
                        throw new AmazonServiceException(string.Format(CultureInfo.InvariantCulture, "Error downloading public IP address ranges file from {0}.", IpAddressRangeEndpoint), e);
                }

                var delay = (int) (Math.Pow(4, retries)*100);
                delay = Math.Min(delay, 30*1000);
                Util.AWSSDKUtils.Sleep(delay);
            }

            return null;
        }