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;
            }
        }
Esempio n. 2
0
        public RTMClient(string endpoint, long pid, long uid, IRTMQuestProcessor serverPushProcessor)
        {
            interLocker         = new object();
            this.pid            = pid;
            this.uid            = uid;
            status              = ClientStatus.Closed;
            requireClose        = false;
            syncConnectingEvent = new ManualResetEvent(false);

            ConnectTimeout = 0;
            QuestTimeout   = 0;

            processor = new RTMQuestProcessor();
            processor.SetProcessor(serverPushProcessor);

            dispatch      = TCPClient.Create(endpoint, true);
            errorRecorder = RTMConfig.errorRecorder;
            if (errorRecorder != null)
            {
                processor.SetErrorRecorder(errorRecorder);
                dispatch.SetErrorRecorder(errorRecorder);
            }
        }
 public void SetProcessor(RTMQuestProcessor processor)
 {
     questProcessor = processor;
 }