Пример #1
0
 internal void CurrentPubnubInstance(Pubnub instance)
 {
     PubnubInstance = instance;
     if (!MultiChannelSubscribe.ContainsKey(instance.InstanceId))
     {
         MultiChannelSubscribe.Add(instance.InstanceId, new ConcurrentDictionary <string, long>());
     }
     if (!MultiChannelGroupSubscribe.ContainsKey(instance.InstanceId))
     {
         MultiChannelGroupSubscribe.Add(instance.InstanceId, new ConcurrentDictionary <string, long>());
     }
     if (!ChannelRequest.ContainsKey(instance.InstanceId))
     {
         ChannelRequest.Add(instance.InstanceId, new ConcurrentDictionary <string, HttpWebRequest>());
     }
     if (!ChannelInternetStatus.ContainsKey(instance.InstanceId))
     {
         ChannelInternetStatus.Add(instance.InstanceId, new ConcurrentDictionary <string, bool>());
     }
     if (!ChannelGroupInternetStatus.ContainsKey(instance.InstanceId))
     {
         ChannelGroupInternetStatus.Add(instance.InstanceId, new ConcurrentDictionary <string, bool>());
     }
     if (!ChannelLocalUserState.ContainsKey(instance.InstanceId))
     {
         ChannelLocalUserState.Add(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
     }
     if (!ChannelGroupLocalUserState.ContainsKey(instance.InstanceId))
     {
         ChannelGroupLocalUserState.Add(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
     }
     if (!ChannelUserState.ContainsKey(instance.InstanceId))
     {
         ChannelUserState.Add(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
     }
     if (!ChannelGroupUserState.ContainsKey(instance.InstanceId))
     {
         ChannelGroupUserState.Add(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
     }
     if (!ChannelReconnectTimer.ContainsKey(instance.InstanceId))
     {
         ChannelReconnectTimer.Add(instance.InstanceId, new ConcurrentDictionary <string, Timer>());
     }
     if (!ChannelGroupReconnectTimer.ContainsKey(instance.InstanceId))
     {
         ChannelGroupReconnectTimer.Add(instance.InstanceId, new ConcurrentDictionary <string, Timer>());
     }
     if (!SubscribeDisconnected.ContainsKey(instance.InstanceId))
     {
         SubscribeDisconnected.Add(instance.InstanceId, false);
     }
     if (!LastSubscribeTimetoken.ContainsKey(instance.InstanceId))
     {
         LastSubscribeTimetoken.Add(instance.InstanceId, 0);
     }
     if (!SubscribeRequestTracker.ContainsKey(instance.InstanceId))
     {
         SubscribeRequestTracker.Add(instance.InstanceId, DateTime.Now);
     }
 }
Пример #2
0
        internal void CurrentPubnubInstance(Pubnub instance)
        {
            PubnubInstance = instance;

            if (!ChannelRequest.ContainsKey(instance.InstanceId))
            {
                ChannelRequest.Add(instance.InstanceId, new ConcurrentDictionary <string, HttpWebRequest>());
            }
            if (!ChannelInternetStatus.ContainsKey(instance.InstanceId))
            {
                ChannelInternetStatus.Add(instance.InstanceId, new ConcurrentDictionary <string, bool>());
            }
            if (!ChannelGroupInternetStatus.ContainsKey(instance.InstanceId))
            {
                ChannelGroupInternetStatus.Add(instance.InstanceId, new ConcurrentDictionary <string, bool>());
            }
            if (!ChannelUserState.ContainsKey(instance.InstanceId))
            {
                ChannelUserState.Add(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
            }
            if (!ChannelGroupUserState.ContainsKey(instance.InstanceId))
            {
                ChannelGroupUserState.Add(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
            }
            if (!ChannelLocalUserState.ContainsKey(instance.InstanceId))
            {
                ChannelLocalUserState.Add(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
            }
            if (!ChannelGroupLocalUserState.ContainsKey(instance.InstanceId))
            {
                ChannelGroupLocalUserState.Add(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
            }
        }
Пример #3
0
        internal void CurrentPubnubInstance(Pubnub instance)
        {
            PubnubInstance = instance;

            if (!MultiChannelSubscribe.ContainsKey(instance.InstanceId))
            {
                MultiChannelSubscribe.Add(instance.InstanceId, new ConcurrentDictionary <string, long>());
            }
            if (!MultiChannelGroupSubscribe.ContainsKey(instance.InstanceId))
            {
                MultiChannelGroupSubscribe.Add(instance.InstanceId, new ConcurrentDictionary <string, long>());
            }
            if (!ChannelRequest.ContainsKey(instance.InstanceId))
            {
                ChannelRequest.Add(instance.InstanceId, new ConcurrentDictionary <string, HttpWebRequest>());
            }
            if (!ChannelInternetStatus.ContainsKey(instance.InstanceId))
            {
                ChannelInternetStatus.Add(instance.InstanceId, new ConcurrentDictionary <string, bool>());
            }
            if (!ChannelGroupInternetStatus.ContainsKey(instance.InstanceId))
            {
                ChannelGroupInternetStatus.Add(instance.InstanceId, new ConcurrentDictionary <string, bool>());
            }
        }