aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Emby.Server.Implementations/Net/SocketFactory.cs2
-rw-r--r--MediaBrowser.Model/Net/ISocketFactory.cs2
-rw-r--r--RSSDP/SsdpCommunicationsServer.cs5
3 files changed, 4 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/Net/SocketFactory.cs b/Emby.Server.Implementations/Net/SocketFactory.cs
index e79a63ff2..0781a0e33 100644
--- a/Emby.Server.Implementations/Net/SocketFactory.cs
+++ b/Emby.Server.Implementations/Net/SocketFactory.cs
@@ -4,7 +4,6 @@ using System;
using System.Net;
using System.Net.Sockets;
using MediaBrowser.Model.Net;
-using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Net
{
@@ -123,6 +122,7 @@ namespace Emby.Server.Implementations.Net
retVal.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse(ipAddress), localIp));
retVal.MulticastLoopback = true;
+
return new UdpSocket(retVal, localPort, localIp);
}
catch
diff --git a/MediaBrowser.Model/Net/ISocketFactory.cs b/MediaBrowser.Model/Net/ISocketFactory.cs
index c4e154064..363abefc1 100644
--- a/MediaBrowser.Model/Net/ISocketFactory.cs
+++ b/MediaBrowser.Model/Net/ISocketFactory.cs
@@ -1,7 +1,6 @@
#pragma warning disable CS1591
using System.Net;
-using Microsoft.Extensions.Logging;
namespace MediaBrowser.Model.Net
{
@@ -25,6 +24,5 @@ namespace MediaBrowser.Model.Net
/// <param name="localPort">The local port to bind to.</param>
/// <returns>A <see cref="ISocket"/> implementation.</returns>
ISocket CreateUdpMulticastSocket(string ipAddress, int multicastTimeToLive, int localPort);
-
}
}
diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs
index 0ff56ebac..3c52a0c2f 100644
--- a/RSSDP/SsdpCommunicationsServer.cs
+++ b/RSSDP/SsdpCommunicationsServer.cs
@@ -338,7 +338,8 @@ namespace Rssdp.Infrastructure
private ISocket ListenForBroadcastsAsync()
{
- var socket = _SocketFactory.CreateUdpMulticastSocket(SsdpConstants.MulticastLocalAdminAddress, _MulticastTtl, SsdpConstants.MulticastPort);
+ var socket = _SocketFactory.CreateUdpMulticastSocket(SsdpConstants.MulticastLocalAdminAddress, _MulticastTtl, SsdpConstants.MulticastPort);
+
_ = ListenToSocketInternal(socket);
return socket;
@@ -382,7 +383,7 @@ namespace Rssdp.Infrastructure
private async Task ListenToSocketInternal(ISocket socket)
{
var cancelled = false;
- var receiveBuffer = new byte[8192];
+ var receiveBuffer = new byte[8192];
while (!cancelled && !IsDisposed)
{