From fde03f21079d793bcecc375865a9b11ca4af0ab8 Mon Sep 17 00:00:00 2001 From: jdomnitz <380352+jdomnitz@users.noreply.github.com> Date: Thu, 4 May 2023 21:59:21 -0400 Subject: [PATCH] Unicast messages are now properly received. Fixes richardschneider#91 --- src/MulticastClient.cs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/MulticastClient.cs b/src/MulticastClient.cs index f7de790..15d823d 100644 --- a/src/MulticastClient.cs +++ b/src/MulticastClient.cs @@ -95,6 +95,7 @@ public MulticastClient(bool useIPv4, bool useIpv6, IEnumerable throw new NotSupportedException($"Address family {address.AddressFamily}."); } + receivers.Add(sender); log.Debug($"Will send via {localEndpoint}"); if (!senders.TryAdd(address, sender)) // Should not fail { @@ -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(); }