Skip to content

Commit

Permalink
Unicast messages are now properly received. Fixes richardschneider#91
Browse files Browse the repository at this point in the history
  • Loading branch information
jdomnitz committed May 5, 2023
1 parent d761d4d commit fde03f2
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/MulticastClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public MulticastClient(bool useIPv4, bool useIpv6, IEnumerable<NetworkInterface>
throw new NotSupportedException($"Address family {address.AddressFamily}.");
}

receivers.Add(sender);
log.Debug($"Will send via {localEndpoint}");
if (!senders.TryAdd(address, sender)) // Should not fail
{
Expand Down Expand Up @@ -197,21 +198,6 @@ protected virtual void Dispose(bool disposing)
}
}
receivers.Clear();

foreach (var address in senders.Keys)
{
if (senders.TryRemove(address, out var sender))
{
try
{
sender.Dispose();
}
catch
{
// eat it.
}
}
}
senders.Clear();
}

Expand Down

0 comments on commit fde03f2

Please sign in to comment.