diff options
| author | Vasily <JustAMan@users.noreply.github.com> | 2020-01-15 13:34:29 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-15 13:34:29 +0300 |
| commit | 3ab979c6ba6351c2c0cf2bd2030de2c1e6bdc92e (patch) | |
| tree | 4a5dda9b1e9ea4deed2c18714385d7fcd8dd473f /Emby.Server.Implementations/Net/SocketFactory.cs | |
| parent | c6484c0220968a6af2f526eef03e5d95cc7e12b3 (diff) | |
| parent | 665ca5cf1fcd6c757f214998d121e3f6a50fb8f3 (diff) | |
Merge pull request #2264 from Bond-009/discovery
Clean up server discovery code
Diffstat (limited to 'Emby.Server.Implementations/Net/SocketFactory.cs')
| -rw-r--r-- | Emby.Server.Implementations/Net/SocketFactory.cs | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/Emby.Server.Implementations/Net/SocketFactory.cs b/Emby.Server.Implementations/Net/SocketFactory.cs index 0870db003..4e04cde78 100644 --- a/Emby.Server.Implementations/Net/SocketFactory.cs +++ b/Emby.Server.Implementations/Net/SocketFactory.cs @@ -8,32 +8,6 @@ namespace Emby.Server.Implementations.Net { public class SocketFactory : ISocketFactory { - /// <summary> - /// Creates a new UDP acceptSocket and binds it to the specified local port. - /// </summary> - /// <param name="localPort">An integer specifying the local port to bind the acceptSocket to.</param> - public ISocket CreateUdpSocket(int localPort) - { - if (localPort < 0) - { - throw new ArgumentException("localPort cannot be less than zero.", nameof(localPort)); - } - - var retVal = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); - - try - { - retVal.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); - return new UdpSocket(retVal, localPort, IPAddress.Any); - } - catch - { - retVal?.Dispose(); - - throw; - } - } - public ISocket CreateUdpBroadcastSocket(int localPort) { if (localPort < 0) @@ -156,8 +130,5 @@ namespace Emby.Server.Implementations.Net throw; } } - - public Stream CreateNetworkStream(ISocket socket, bool ownsSocket) - => new NetworkStream(((UdpSocket)socket).Socket, ownsSocket); } } |
