diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-08-27 13:34:55 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-27 13:34:55 -0400 |
| commit | f3ee129bd9e88e8768221ba176bc8356f9b240e3 (patch) | |
| tree | 72dc082f77629e8d70f764d175433b40ac4c02d0 /SocketHttpListener/Net/EndPointManager.cs | |
| parent | 4f8684a16b1102056bd2b527dcbd585b78dd8000 (diff) | |
| parent | fa6bec94b59cf850246c5d0757b9279d080643d7 (diff) | |
Merge pull request #2847 from MediaBrowser/beta
Beta
Diffstat (limited to 'SocketHttpListener/Net/EndPointManager.cs')
| -rw-r--r-- | SocketHttpListener/Net/EndPointManager.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/SocketHttpListener/Net/EndPointManager.cs b/SocketHttpListener/Net/EndPointManager.cs index 6a00ed360..ddb110ec1 100644 --- a/SocketHttpListener/Net/EndPointManager.cs +++ b/SocketHttpListener/Net/EndPointManager.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Linq; using System.Net; using System.Reflection; using System.Threading.Tasks; @@ -83,7 +82,9 @@ namespace SocketHttpListener.Net { try { - addr = (await networkManager.GetHostAddressesAsync(host).ConfigureAwait(false)).FirstOrDefault() ?? + var all = (await networkManager.GetHostAddressesAsync(host).ConfigureAwait(false)); + + addr = (all.Length == 0 ? null : all[0]) ?? GetIpAnyAddress(listener); } catch |
