diff options
| author | artiume <siderite@gmail.com> | 2020-01-26 09:33:31 -0500 |
|---|---|---|
| committer | artiume <siderite@gmail.com> | 2020-01-26 09:33:31 -0500 |
| commit | 918df5e352889a5d990e2a9feb1e838f3acc9a39 (patch) | |
| tree | 8c029e97e7e55ce5780709f047710da0807668cb /Emby.Server.Implementations/Net/SocketFactory.cs | |
| parent | 0cbae4a06d49acccfd7a757039f7f6725cdc53a5 (diff) | |
| parent | e58aa57ed75417f8eb80c55fb1b782153f924fb8 (diff) | |
Merge remote-tracking branch 'jellyfin/master'
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); } } |
