Chimney.MPD.ChimneyMPDEvent.IdleEventLoop C# (CSharp) Method

IdleEventLoop() private method

private IdleEventLoop ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
        private async Task IdleEventLoop()
        {
            int attemps = 3;

            while(idle)
            {
                List<string> tempresponselist = await Idle();

                if (tempresponselist.Count > 0)
                {
                    await NoIdle();
                    responselist = tempresponselist;
                    await ActionOnEventLoop();
                    attemps = 3;
                    idle = true;
                }
                else if (attemps > 0 && idle)
                {
                    await Connect(this.host, this.port, this.password, false);
                    attemps--;
                }
                else if(idle)
                {
                    idle = false;
                    attemps = 3;
                    connectionproblem = true;
                    SendConnectionProblem();
                } 
            }
        }