aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-06-30 00:23:52 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-06-30 00:23:52 -0400
commit525f7804532bb0d5a1dc38668fbcf511acc2877c (patch)
tree9093ffe63d6c18a6565d1f57b337e622f71cec87 /MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs
parentcbeb77c0ad366f25e3cb26d80e27648598240c59 (diff)
add startup error handling
Diffstat (limited to 'MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs
index 79872b100..28a62c012 100644
--- a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs
+++ b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs
@@ -44,11 +44,12 @@ namespace MediaBrowser.Server.Implementations.Connect
LoadCachedAddress();
_timer = new PeriodicTimer(TimerCallback, null, TimeSpan.FromSeconds(5), TimeSpan.FromHours(3));
+ ((ConnectManager)_connectManager).Start();
}
private readonly string[] _ipLookups =
{
- "http://bot.whatismyipaddress.com",
+ "http://bot.whatismyipaddress.com",
"https://connect.emby.media/service/ip"
};
@@ -78,17 +79,18 @@ namespace MediaBrowser.Server.Implementations.Connect
}
// If this produced an ipv6 address, try again
- if (validIpAddress == null || validIpAddress.AddressFamily == AddressFamily.InterNetworkV6)
+ if (validIpAddress != null && validIpAddress.AddressFamily == AddressFamily.InterNetworkV6)
{
foreach (var ipLookupUrl in _ipLookups)
{
try
{
- validIpAddress = await GetIpAddress(ipLookupUrl, true).ConfigureAwait(false);
+ var newAddress = await GetIpAddress(ipLookupUrl, true).ConfigureAwait(false);
// Try to find the ipv4 address, if present
- if (validIpAddress.AddressFamily == AddressFamily.InterNetwork)
+ if (newAddress.AddressFamily == AddressFamily.InterNetwork)
{
+ validIpAddress = newAddress;
break;
}
}