From f1aba6b95230474d47c580071370c7dbd00eba13 Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Thu, 9 Nov 2023 14:45:16 -0500 Subject: Remove Emby.Dlna --- Emby.Server.Implementations/ApplicationHost.cs | 4 ---- Emby.Server.Implementations/Emby.Server.Implementations.csproj | 1 - Emby.Server.Implementations/SystemManager.cs | 1 - 3 files changed, 6 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 4540ab205a..8955424099 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -13,7 +13,6 @@ using System.Net; using System.Reflection; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; -using Emby.Dlna.Main; using Emby.Naming.Common; using Emby.Photos; using Emby.Server.Implementations.Channels; @@ -867,9 +866,6 @@ namespace Emby.Server.Implementations // MediaEncoding yield return typeof(MediaBrowser.MediaEncoding.Encoder.MediaEncoder).Assembly; - // Dlna - yield return typeof(DlnaHost).Assembly; - // Local metadata yield return typeof(BoxSetXmlSaver).Assembly; diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index 905f36e43e..abe3871816 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -14,7 +14,6 @@ - diff --git a/Emby.Server.Implementations/SystemManager.cs b/Emby.Server.Implementations/SystemManager.cs index 2c477218fe..c4552474cb 100644 --- a/Emby.Server.Implementations/SystemManager.cs +++ b/Emby.Server.Implementations/SystemManager.cs @@ -1,4 +1,3 @@ -using System; using System.Linq; using System.Threading.Tasks; using MediaBrowser.Common.Configuration; -- cgit v1.2.3 From e46e3be667c76ff9a242d7499aff83d2d10881ed Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Thu, 9 Nov 2023 15:57:19 -0500 Subject: Remove DLNA socket code --- Emby.Server.Implementations/Net/SocketFactory.cs | 80 ------------------------ MediaBrowser.Model/Net/ISocketFactory.cs | 18 ------ 2 files changed, 98 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/Net/SocketFactory.cs b/Emby.Server.Implementations/Net/SocketFactory.cs index 2bcd5eab29..a3484f43e9 100644 --- a/Emby.Server.Implementations/Net/SocketFactory.cs +++ b/Emby.Server.Implementations/Net/SocketFactory.cs @@ -1,7 +1,5 @@ using System; -using System.Linq; using System.Net; -using System.Net.NetworkInformation; using System.Net.Sockets; using MediaBrowser.Model.Net; @@ -37,83 +35,5 @@ namespace Emby.Server.Implementations.Net throw; } } - - /// - public Socket CreateSsdpUdpSocket(IPData bindInterface, int localPort) - { - var interfaceAddress = bindInterface.Address; - ArgumentNullException.ThrowIfNull(interfaceAddress); - - if (localPort < 0) - { - throw new ArgumentException("localPort cannot be less than zero.", nameof(localPort)); - } - - var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); - try - { - socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); - socket.Bind(new IPEndPoint(interfaceAddress, localPort)); - - return socket; - } - catch - { - socket.Dispose(); - - throw; - } - } - - /// - public Socket CreateUdpMulticastSocket(IPAddress multicastAddress, IPData bindInterface, int multicastTimeToLive, int localPort) - { - var bindIPAddress = bindInterface.Address; - ArgumentNullException.ThrowIfNull(multicastAddress); - ArgumentNullException.ThrowIfNull(bindIPAddress); - - if (multicastTimeToLive <= 0) - { - throw new ArgumentException("multicastTimeToLive cannot be zero or less.", nameof(multicastTimeToLive)); - } - - if (localPort < 0) - { - throw new ArgumentException("localPort cannot be less than zero.", nameof(localPort)); - } - - var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); - - try - { - socket.MulticastLoopback = false; - socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); - socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.PacketInformation, true); - socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, multicastTimeToLive); - - if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()) - { - socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(multicastAddress)); - socket.Bind(new IPEndPoint(multicastAddress, localPort)); - } - else - { - // Only create socket if interface supports multicast - var interfaceIndex = bindInterface.Index; - var interfaceIndexSwapped = IPAddress.HostToNetworkOrder(interfaceIndex); - - socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(multicastAddress, interfaceIndex)); - socket.Bind(new IPEndPoint(bindIPAddress, localPort)); - } - - return socket; - } - catch - { - socket.Dispose(); - - throw; - } - } } } diff --git a/MediaBrowser.Model/Net/ISocketFactory.cs b/MediaBrowser.Model/Net/ISocketFactory.cs index 128034eb8f..62b87d9f57 100644 --- a/MediaBrowser.Model/Net/ISocketFactory.cs +++ b/MediaBrowser.Model/Net/ISocketFactory.cs @@ -14,22 +14,4 @@ public interface ISocketFactory /// The local port to bind to. /// A new unicast socket using the specified local port number. Socket CreateUdpBroadcastSocket(int localPort); - - /// - /// Creates a new unicast socket using the specified local port number. - /// - /// The bind interface. - /// The local port to bind to. - /// A new unicast socket using the specified local port number. - Socket CreateSsdpUdpSocket(IPData bindInterface, int localPort); - - /// - /// Creates a new multicast socket using the specified multicast IP address, multicast time to live and local port. - /// - /// The multicast IP address to bind to. - /// The bind interface. - /// The multicast time to live value. Actually a maximum number of network hops for UDP packets. - /// The local port to bind to. - /// A new multicast socket using the specfied bind interface, multicast address, multicast time to live and port. - Socket CreateUdpMulticastSocket(IPAddress multicastAddress, IPData bindInterface, int multicastTimeToLive, int localPort); } -- cgit v1.2.3