aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/SsdpDeviceLocator.cs
diff options
context:
space:
mode:
authorBaronGreenback <jimcartlidge@yahoo.co.uk>2021-04-20 18:10:38 +0100
committerGitHub <noreply@github.com>2021-04-20 18:10:38 +0100
commitf8b717e7c51a771b937312af3f1aa77e044b86ce (patch)
tree1de949627db1b7b033ea47e34ae5d7e2a8a70bd3 /RSSDP/SsdpDeviceLocator.cs
parent7848ea148438baf8929e1c2939e6979cb84aad1a (diff)
parent5a6e60b414046c274330479f7dfb9713eea20020 (diff)
Merge branch 'master' into ProfileMatch
Diffstat (limited to 'RSSDP/SsdpDeviceLocator.cs')
-rw-r--r--RSSDP/SsdpDeviceLocator.cs14
1 files changed, 6 insertions, 8 deletions
diff --git a/RSSDP/SsdpDeviceLocator.cs b/RSSDP/SsdpDeviceLocator.cs
index bfad6de97..0cdc5ce3d 100644
--- a/RSSDP/SsdpDeviceLocator.cs
+++ b/RSSDP/SsdpDeviceLocator.cs
@@ -97,6 +97,11 @@ namespace Rssdp.Infrastructure
private async void OnBroadcastTimerCallback(object state)
{
+ if (IsDisposed)
+ {
+ return;
+ }
+
StartListeningForNotifications();
RemoveExpiredDevicesFromCache();
@@ -180,8 +185,6 @@ namespace Rssdp.Infrastructure
/// <exception cref="ObjectDisposedException">Throw if the <see cref="DisposableManagedObjectBase.IsDisposed"/> ty is true.</exception>
public void StartListeningForNotifications()
{
- ThrowIfDisposed();
-
_CommunicationsServer.RequestReceived -= CommsServer_RequestReceived;
_CommunicationsServer.RequestReceived += CommsServer_RequestReceived;
_CommunicationsServer.BeginListeningForBroadcasts();
@@ -353,7 +356,7 @@ namespace Rssdp.Infrastructure
{
return;
}
-
+
var location = GetFirstHeaderUriValue("Location", message);
if (location != null)
{
@@ -515,11 +518,6 @@ namespace Rssdp.Infrastructure
private void RemoveExpiredDevicesFromCache()
{
- if (this.IsDisposed)
- {
- return;
- }
-
DiscoveredSsdpDevice[] expiredDevices = null;
lock (_Devices)
{