From 88d5e342107ba465925f476b3868e93c48d4cbff Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Sun, 17 Mar 2013 12:31:02 -0400 Subject: [PATCH] fix udp server messages --- .../NetworkManagement/NetworkManager.cs | 2 +- .../ServerManager/ServerManager.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Common.Implementations/NetworkManagement/NetworkManager.cs b/MediaBrowser.Common.Implementations/NetworkManagement/NetworkManager.cs index c0038de2eb..513339eef5 100644 --- a/MediaBrowser.Common.Implementations/NetworkManagement/NetworkManager.cs +++ b/MediaBrowser.Common.Implementations/NetworkManagement/NetworkManager.cs @@ -24,7 +24,7 @@ namespace MediaBrowser.Common.Implementations.NetworkManagement { var host = Dns.GetHostEntry(Dns.GetHostName()); - var ip = host.AddressList.FirstOrDefault(i => i.AddressFamily == AddressFamily.InterNetwork); + var ip = host.AddressList.LastOrDefault(i => i.AddressFamily == AddressFamily.InterNetwork); if (ip == null) { diff --git a/MediaBrowser.Server.Implementations/ServerManager/ServerManager.cs b/MediaBrowser.Server.Implementations/ServerManager/ServerManager.cs index d97e398662..119a045cdb 100644 --- a/MediaBrowser.Server.Implementations/ServerManager/ServerManager.cs +++ b/MediaBrowser.Server.Implementations/ServerManager/ServerManager.cs @@ -296,7 +296,7 @@ namespace MediaBrowser.Server.Implementations.ServerManager _logger.Info("Received UDP server request from " + e.RemoteEndPoint); // Send a response back with our ip address and port - var response = String.Format("MediaBrowser{0}|{1}:{2}", context, _networkManager.GetLocalIpAddress(), _kernel.UdpServerPortNumber); + var response = String.Format("MediaBrowser{0}|{1}:{2}", context, _networkManager.GetLocalIpAddress(), ConfigurationManager.Configuration.HttpServerPortNumber); await UdpServer.SendAsync(Encoding.UTF8.GetBytes(response), e.RemoteEndPoint); }