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

            if (!MultiChannelSubscribe.ContainsKey(instance.InstanceId))
            {
                MultiChannelSubscribe.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, long>());
            }
            if (!MultiChannelGroupSubscribe.ContainsKey(instance.InstanceId))
            {
                MultiChannelGroupSubscribe.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, long>());
            }
            if (!ChannelRequest.ContainsKey(instance.InstanceId))
            {
                ChannelRequest.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, HttpWebRequest>());
            }
            if (!ChannelInternetStatus.ContainsKey(instance.InstanceId))
            {
                ChannelInternetStatus.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, bool>());
            }
            if (!ChannelGroupInternetStatus.ContainsKey(instance.InstanceId))
            {
                ChannelGroupInternetStatus.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, bool>());
            }
        }
コード例 #3
0
        internal void CurrentPubnubInstance(Pubnub instance)
        {
            PubnubInstance = instance;

            if (!ChannelRequest.ContainsKey(instance.InstanceId))
            {
                ChannelRequest.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, HttpWebRequest>());
            }
            if (!ChannelInternetStatus.ContainsKey(instance.InstanceId))
            {
                ChannelInternetStatus.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, bool>());
            }
            if (!ChannelGroupInternetStatus.ContainsKey(instance.InstanceId))
            {
                ChannelGroupInternetStatus.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, bool>());
            }
            if (!ChannelUserState.ContainsKey(instance.InstanceId))
            {
                ChannelUserState.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
            }
            if (!ChannelGroupUserState.ContainsKey(instance.InstanceId))
            {
                ChannelGroupUserState.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
            }
            if (!ChannelLocalUserState.ContainsKey(instance.InstanceId))
            {
                ChannelLocalUserState.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
            }
            if (!ChannelGroupLocalUserState.ContainsKey(instance.InstanceId))
            {
                ChannelGroupLocalUserState.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
            }
        }
コード例 #4
0
        public SetStateOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, instance)
        {
            config             = pubnubConfig;
            jsonLibrary        = jsonPluggableLibrary;
            unit               = pubnubUnit;
            pubnubLog          = log;
            pubnubTelemetryMgr = telemetryManager;

            PubnubInstance = instance;

            if (!ChannelRequest.ContainsKey(instance.InstanceId))
            {
                ChannelRequest.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, HttpWebRequest>());
            }
            if (!ChannelInternetStatus.ContainsKey(instance.InstanceId))
            {
                ChannelInternetStatus.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, bool>());
            }
            if (!ChannelGroupInternetStatus.ContainsKey(instance.InstanceId))
            {
                ChannelGroupInternetStatus.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, bool>());
            }
            if (!ChannelUserState.ContainsKey(instance.InstanceId))
            {
                ChannelUserState.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
            }
            if (!ChannelGroupUserState.ContainsKey(instance.InstanceId))
            {
                ChannelGroupUserState.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
            }
            if (!ChannelLocalUserState.ContainsKey(instance.InstanceId))
            {
                ChannelLocalUserState.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
            }
            if (!ChannelGroupLocalUserState.ContainsKey(instance.InstanceId))
            {
                ChannelGroupLocalUserState.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, Dictionary <string, object> >());
            }
        }
コード例 #5
0
        public GenerateFileUploadUrlOperation(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubUnitTest pubnubUnit, IPubnubLog log, EndPoint.TelemetryManager telemetryManager, Pubnub instance) : base(pubnubConfig, jsonPluggableLibrary, pubnubUnit, log, telemetryManager, instance)
        {
            config             = pubnubConfig;
            jsonLibrary        = jsonPluggableLibrary;
            unit               = pubnubUnit;
            pubnubLog          = log;
            pubnubTelemetryMgr = telemetryManager;

            if (instance != null)
            {
                if (!ChannelRequest.ContainsKey(instance.InstanceId))
                {
                    ChannelRequest.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, HttpWebRequest>());
                }
                if (!ChannelInternetStatus.ContainsKey(instance.InstanceId))
                {
                    ChannelInternetStatus.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, bool>());
                }
                if (!ChannelGroupInternetStatus.ContainsKey(instance.InstanceId))
                {
                    ChannelGroupInternetStatus.GetOrAdd(instance.InstanceId, new ConcurrentDictionary <string, bool>());
                }
            }
        }