aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Dlna
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-09-15 22:42:28 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-09-15 22:42:28 -0400
commit7177512a4551201d721a64ebc8f1fbe15266b6de (patch)
tree2b8bfec63c739ca87a918ea3e38a3374359e19b0 /MediaBrowser.Dlna
parentcc6680f48f76278fecc0efc6b6732effe6fe1e2a (diff)
update ssdp handling
Diffstat (limited to 'MediaBrowser.Dlna')
-rw-r--r--MediaBrowser.Dlna/Main/DlnaEntryPoint.cs21
1 files changed, 9 insertions, 12 deletions
diff --git a/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs b/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs
index b1205710a6..c3810a9e6e 100644
--- a/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs
+++ b/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs
@@ -15,6 +15,7 @@ using MediaBrowser.Model.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Net;
using System.Threading.Tasks;
using MediaBrowser.Controller.MediaEncoding;
using Rssdp;
@@ -220,9 +221,11 @@ namespace MediaBrowser.Dlna.Main
}
var cacheLength = _config.GetDlnaConfiguration().BlastAliveMessageIntervalSeconds * 2;
- _Publisher.SupportPnpRootDevice = true;
+ _Publisher.SupportPnpRootDevice = false;
- foreach (var address in await _appHost.GetLocalIpAddresses().ConfigureAwait(false))
+ var addresses = (await _appHost.GetLocalIpAddresses().ConfigureAwait(false)).ToList();
+
+ foreach (var address in addresses)
{
//if (IPAddress.IsLoopback(address))
//{
@@ -334,17 +337,11 @@ namespace MediaBrowser.Dlna.Main
{
var devices = _Publisher.Devices.ToList();
- Parallel.ForEach(devices, device =>
+ foreach (var device in devices)
{
- try
- {
- _Publisher.RemoveDevice(device);
- }
- catch (Exception ex)
- {
- _logger.ErrorException("Error sending bye bye", ex);
- }
- });
+ var task = _Publisher.RemoveDevice(device);
+ Task.WaitAll(task);
+ }
//foreach (var device in devices)
//{
// try