diff --git a/Emby.Server.Implementations/Net/SocketFactory.cs b/Emby.Server.Implementations/Net/SocketFactory.cs index e0c75698d2..b6d87a7880 100644 --- a/Emby.Server.Implementations/Net/SocketFactory.cs +++ b/Emby.Server.Implementations/Net/SocketFactory.cs @@ -61,14 +61,10 @@ namespace Emby.Server.Implementations.Net } /// - public ISocket CreateUdpMulticastSocket(IPAddress ipAddress, IPAddress? bindIpAddress, int multicastTimeToLive, int localPort) + public ISocket CreateUdpMulticastSocket(IPAddress ipAddress, IPAddress bindIpAddress, int multicastTimeToLive, int localPort) { ArgumentNullException.ThrowIfNull(ipAddress); - - if (bindIpAddress == null) - { - bindIpAddress = IPAddress.Any; - } + ArgumentNullException.ThrowIfNull(bindIpAddress); if (multicastTimeToLive <= 0) { diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs index da357546dd..fb5a66aa10 100644 --- a/RSSDP/SsdpCommunicationsServer.cs +++ b/RSSDP/SsdpCommunicationsServer.cs @@ -336,13 +336,15 @@ namespace Rssdp.Infrastructure private List ListenForBroadcasts() { var sockets = new List(); + var nonNullBindAddresses = _networkManager.GetInternalBindAddresses().Where(x => x.Address != null); + if (_enableMultiSocketBinding) { - foreach (var address in _networkManager.GetInternalBindAddresses()) + foreach (var address in nonNullBindAddresses) { if (address.AddressFamily == AddressFamily.InterNetworkV6) { - // Not support IPv6 right now + // Not supporting IPv6 right now continue; } @@ -379,7 +381,7 @@ namespace Rssdp.Infrastructure { if (address.AddressFamily == AddressFamily.InterNetworkV6) { - // Not support IPv6 right now + // Not supporting IPv6 right now continue; }