Skip to content

Commit 0af235b

Browse files
author
Oren Novotny
authored
Merge pull request #140 from spudwebb/fixlistener
Fix ResolverListener so that ServiceLost is called only after N successive failed pings
2 parents e2246a1 + 058888b commit 0af235b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Zeroconf/ZeroConfResolver.Listener.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ void OnResolved(IReadOnlyList<IZeroconfHost> hosts)
9898
{
9999
ServiceFound?.Invoke(this, host);
100100
newHosts.Add(keyValue);
101-
if (toRemove.ContainsKey(keyValue)) toRemove.Remove(keyValue);
102101
}
102+
if (toRemove.ContainsKey(keyValue))
103+
toRemove.Remove(keyValue);
103104
}
104105
}
105106

0 commit comments

Comments
 (0)