diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-03-09 12:53:39 -0500 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2016-03-09 12:53:39 -0500 |
| commit | 00eab4146c0b103ab38565eef58b521d47343c63 (patch) | |
| tree | c71e7568427015e968fe87f925b2aa57bade062a /MediaBrowser.Server.Startup.Common | |
| parent | 91c949bd65092395c9aea3584c66bbec6db7c411 (diff) | |
| parent | aa23da0dc44afbfe47a83d2dda0644472ad4e0e4 (diff) | |
Merge pull request #1539 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Startup.Common')
| -rw-r--r-- | MediaBrowser.Server.Startup.Common/ApplicationHost.cs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index b71fe365d3..269c306694 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -97,6 +97,7 @@ using System.Globalization; using System.IO; using System.Linq; using System.Net; +using System.Net.Sockets; using System.Reflection; using System.Threading; using System.Threading.Tasks; @@ -322,7 +323,7 @@ namespace MediaBrowser.Server.Startup.Common { TaskManager.SuspendTriggers = true; } - + await base.RunStartupTasks().ConfigureAwait(false); Logger.Info("ServerId: {0}", SystemId); @@ -1134,7 +1135,7 @@ namespace MediaBrowser.Server.Startup.Common if (address != null) { - return GetLocalApiUrl(address.ToString()); + return GetLocalApiUrl(address); } return null; @@ -1148,6 +1149,16 @@ namespace MediaBrowser.Server.Startup.Common } } + public string GetLocalApiUrl(IPAddress ipAddress) + { + if (ipAddress.AddressFamily == AddressFamily.InterNetworkV6) + { + return GetLocalApiUrl("[" + ipAddress + "]"); + } + + return GetLocalApiUrl(ipAddress.ToString()); + } + public string GetLocalApiUrl(string host) { return string.Format("http://{0}:{1}", @@ -1180,7 +1191,7 @@ namespace MediaBrowser.Server.Startup.Common return true; } - var apiUrl = GetLocalApiUrl(address.ToString()); + var apiUrl = GetLocalApiUrl(address); apiUrl += "/system/ping"; if ((DateTime.UtcNow - _lastAddressCacheClear).TotalMinutes >= 5) |
