public void RemoveChannel(string channelId) { if (string.IsNullOrEmpty(channelId)) { return; } try { if (channelLoopup.ContainsKey(channelId)) { FizzChannel fizzChannel = channelLoopup[channelId]; channelLoopup.Remove(channelId); Channels.Remove(fizzChannel); fizzChannel.Unsubscribe(ex => { }); } } catch { } }
public void UnsubscribeChannel(string channelId) { if (!_isIntialized) { Initialize(); } if (Client.State == FizzClientState.Closed) { FizzLogger.W("FizzClient should be opened before unsubscribing channel."); return; } if (string.IsNullOrEmpty(channelId)) { FizzLogger.E("FizzClient unable to unsubscribe, channelId is null or empty."); return; } try { if (channelLoopup.ContainsKey(channelId)) { FizzChannel fizzChannel = channelLoopup[channelId]; channelLoopup.Remove(channelId); Channels.Remove(fizzChannel); fizzChannel.Unsubscribe(ex => { }); } else { FizzLogger.W("FizzService unable to unsubscribe, channel [" + channelId + "] does not exist. "); } } catch (Exception e) { FizzLogger.E(e); } }