IPCConnectedFactoryExchange / CFX

Apache License 2.0
79 stars 71 forks source link

Fix for clearing all channels related to a URI when unsubscribing from a subscribe or publish channel. issues/116 #213

Closed MercyPillow closed 2 months ago

MercyPillow commented 4 months ago

Changed CloseSubscribeChannel and ClosePublishChannel to not remove the networkAddress channel key from the dictionary

// removed while (!channels.TryRemove(key, out channel)) Task.Yield();

// replaced channel = channels[key];

this allows one to add multiple subscription channels for one URI AND then remove them.

//re-added // only when 'List<>'channel.channels is empty while (!channels.TryRemove(key, out channel)) Task.Yield();

issue existing since 2021 see: https://github.com/IPCConnectedFactoryExchange/CFX/issues/116