ApiCore.Messages.LongPollServerConnection.Start C# (CSharp) Method

Start() public method

Start listening server connection
public Start ( ) : void
return void
        public void Start()
        {
            this.sync = SynchronizationContext.Current;
            this.stopPending = false;
            if (this.connectionListenerThread != null)
            {

                if (this.connectionListenerThread.ThreadState == System.Threading.ThreadState.Stopped)
                {
                    //ThreadStart ts = new ThreadStart(this.run);
                    this.connectionListenerThread = new Thread(this.run);
                    this.connectionListenerThread.Start(this.sync);
                }
                if (this.connectionListenerThread.ThreadState == System.Threading.ThreadState.Unstarted || this.connectionListenerThread.ThreadState == System.Threading.ThreadState.Suspended)
                {
                    this.connectionListenerThread = new Thread(this.run);
                    this.connectionListenerThread.Start(this.sync);
                }
                this.connectionListenerThread.IsBackground = true;
            }
            else
            {
                //ThreadStart ts = new ThreadStart(this.run);
                this.connectionListenerThread = new Thread(this.run);
                this.Start();
            }
        }