aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Net/SocketFactory.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2023-12-05 16:16:19 +0100
committerGitHub <noreply@github.com>2023-12-05 16:16:19 +0100
commit000ccaa6dbf948aa427a8daac7d550dd598b3b5b (patch)
tree9b195f8157d1b29c1096729f193da387855f9137 /Emby.Server.Implementations/Net/SocketFactory.cs
parentf7d61912a26e927e52f1340bbed7bca2da212d93 (diff)
parenteea676429b603c9a19e098b1a99c6c024af95ec7 (diff)
Merge pull request #10660 from barronpm/move-networking
Move Jellyfin.Networking
Diffstat (limited to 'Emby.Server.Implementations/Net/SocketFactory.cs')
-rw-r--r--Emby.Server.Implementations/Net/SocketFactory.cs39
1 files changed, 0 insertions, 39 deletions
diff --git a/Emby.Server.Implementations/Net/SocketFactory.cs b/Emby.Server.Implementations/Net/SocketFactory.cs
deleted file mode 100644
index a3484f43e..000000000
--- a/Emby.Server.Implementations/Net/SocketFactory.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Net;
-using System.Net.Sockets;
-using MediaBrowser.Model.Net;
-
-namespace Emby.Server.Implementations.Net
-{
- /// <summary>
- /// Factory class to create different kinds of sockets.
- /// </summary>
- public class SocketFactory : ISocketFactory
- {
- /// <inheritdoc />
- public Socket CreateUdpBroadcastSocket(int localPort)
- {
- 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.EnableBroadcast = true;
- socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
- socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1);
- socket.Bind(new IPEndPoint(IPAddress.Any, localPort));
-
- return socket;
- }
- catch
- {
- socket.Dispose();
-
- throw;
- }
- }
- }
-}