aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/Ssdp
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-11-04 04:31:05 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-11-04 04:31:05 -0400
commit6d250c4050ceb0bda33aad6a484fd05e508c4e27 (patch)
tree9776c6fe796bcbbea2d753ddd78d925a5645d69a /Emby.Dlna/Ssdp
parentc29394a81a8d00e16e2706850ae9127933e73cda (diff)
make dlna project portable
Diffstat (limited to 'Emby.Dlna/Ssdp')
-rw-r--r--Emby.Dlna/Ssdp/DeviceDiscovery.cs12
-rw-r--r--Emby.Dlna/Ssdp/Extensions.cs1
2 files changed, 9 insertions, 4 deletions
diff --git a/Emby.Dlna/Ssdp/DeviceDiscovery.cs b/Emby.Dlna/Ssdp/DeviceDiscovery.cs
index f106496b9d..6f58429680 100644
--- a/Emby.Dlna/Ssdp/DeviceDiscovery.cs
+++ b/Emby.Dlna/Ssdp/DeviceDiscovery.cs
@@ -7,12 +7,13 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
-using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Net;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Events;
+using MediaBrowser.Model.Net;
+using MediaBrowser.Model.Threading;
using Rssdp;
namespace Emby.Dlna.Ssdp
@@ -30,18 +31,23 @@ namespace Emby.Dlna.Ssdp
private SsdpDeviceLocator _DeviceLocator;
- public DeviceDiscovery(ILogger logger, IServerConfigurationManager config)
+ private readonly ITimerFactory _timerFactory;
+ private readonly ISocketFactory _socketFactory;
+
+ public DeviceDiscovery(ILogger logger, IServerConfigurationManager config, ISocketFactory socketFactory, ITimerFactory timerFactory)
{
_tokenSource = new CancellationTokenSource();
_logger = logger;
_config = config;
+ _socketFactory = socketFactory;
+ _timerFactory = timerFactory;
}
// Call this method from somewhere in your code to start the search.
public void BeginSearch()
{
- _DeviceLocator = new SsdpDeviceLocator();
+ _DeviceLocator = new SsdpDeviceLocator(_socketFactory, _timerFactory);
// (Optional) Set the filter so we only see notifications for devices we care about
// (can be any search target value i.e device type, uuid value etc - any value that appears in the
diff --git a/Emby.Dlna/Ssdp/Extensions.cs b/Emby.Dlna/Ssdp/Extensions.cs
index 731f3ab0b5..611bf7e022 100644
--- a/Emby.Dlna/Ssdp/Extensions.cs
+++ b/Emby.Dlna/Ssdp/Extensions.cs
@@ -1,7 +1,6 @@
using System;
using System.Linq;
using System.Net;
-using System.Net.Sockets;
using System.Threading.Tasks;
using System.Xml.Linq;