public RTMClient(string endpoint, long projectId, long uid, RTMQuestProcessor serverPushProcessor, bool autoRelogin = true)
        {
            interLocker         = new object();
            this.projectId      = projectId;
            this.uid            = uid;
            status              = ClientStatus.Closed;
            requireClose        = false;
            syncConnectingEvent = new ManualResetEvent(false);

            ConnectTimeout = 0;
            QuestTimeout   = 0;

            RTMMasterProcessor processorCurrent = new RTMMasterProcessor();

            processorCurrent.SetProcessor(serverPushProcessor);
            processor = processorCurrent;

            errorRecorder = RTMConfig.errorRecorder;
            if (errorRecorder != null)
            {
                processor.SetErrorRecorder(errorRecorder);
            }

            BuildRtmGateClient(endpoint);

            if (autoRelogin)
            {
                autoReloginInfo    = new AutoReloginInfo();
                regressiveStrategy = RTMConfig.globalRegressiveStrategy;
            }
        }
Exemplo n.º 2
0
        public RTMConfig()
        {
            maxPingInterval          = 60;
            globalConnectTimeout     = 30;
            globalQuestTimeout       = 30;
            fileClientHoldingSeconds = 150;
            forceTriggerCallbackWhenAsyncMethodReturnFalse = false;

            regressiveStrategy = new RegressiveStrategy();
        }
Exemplo n.º 3
0
        internal static void Config(RTMConfig config)
        {
            lostConnectionAfterLastPingInSeconds = config.maxPingInterval;
            globalConnectTimeoutSeconds          = config.globalConnectTimeout;
            globalQuestTimeoutSeconds            = config.globalQuestTimeout;
            fileGateClientHoldingSeconds         = config.fileClientHoldingSeconds;
            errorRecorder = config.defaultErrorRecorder;
            triggerCallbackIfAsyncMethodReturnFalse = config.forceTriggerCallbackWhenAsyncMethodReturnFalse;

            globalRegressiveStrategy = config.regressiveStrategy;
        }
 public void SetRegressiveStrategy(RegressiveStrategy strategy)
 {
     regressiveStrategy = strategy;
 }