Beispiel #1
0
        // Token: 0x06000CBE RID: 3262 RVA: 0x0002F354 File Offset: 0x0002D554
        private void Unsubscribe(string subscriptionId, SubscriptionParameters parameters)
        {
            BrokerHandlerReferenceCounter brokerHandlerReferenceCounter = null;

            lock (this.syncRoot)
            {
                if (this.isDisposed)
                {
                    return;
                }
                BrokerHandlerReferenceCounter brokerHandlerReferenceCounter2;
                if (this.activeHandlers.TryGetValue(subscriptionId, out brokerHandlerReferenceCounter2))
                {
                    brokerHandlerReferenceCounter2.Remove(parameters.ChannelId);
                    if (brokerHandlerReferenceCounter2.Count == 0)
                    {
                        this.activeHandlers.Remove(subscriptionId);
                        brokerHandlerReferenceCounter = brokerHandlerReferenceCounter2;
                    }
                }
            }
            if (brokerHandlerReferenceCounter != null)
            {
                brokerHandlerReferenceCounter.Dispose();
            }
        }
Beispiel #2
0
 // Token: 0x06000CBD RID: 3261 RVA: 0x0002F2E4 File Offset: 0x0002D4E4
 private void Subscribe(string subscriptionId, string channelId, Func <BrokerHandler> createHandlerDelegate)
 {
     lock (this.syncRoot)
     {
         if (!this.isDisposed)
         {
             BrokerHandlerReferenceCounter brokerHandlerReferenceCounter;
             if (!this.activeHandlers.TryGetValue(subscriptionId, out brokerHandlerReferenceCounter))
             {
                 brokerHandlerReferenceCounter       = new BrokerHandlerReferenceCounter(createHandlerDelegate);
                 this.activeHandlers[subscriptionId] = brokerHandlerReferenceCounter;
             }
             brokerHandlerReferenceCounter.Add(channelId);
         }
     }
 }