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;
}