Beispiel #1
0
        protected virtual void IdlePause()
        {
            if (_IdleTask == null || !_Idling)
            {
                return;
            }
            CheckConnectionStatus();
            SendCommand("DONE");

            if (!_IdleTask.Wait(ServerTimeout))
            {
                //Not responding
                Disconnect();
                ImapClientException          e    = new ImapClientException("Lost communication to IMAP server, connection closed.");
                ImapClientExceptionEventArgs args = new ImapClientExceptionEventArgs(e);
                Task.Factory.StartNew(() => ImapException.Fire(this, args));
            }
            _IdleTask.Dispose();
            _IdleTask = null;
        }
        protected virtual void IdlePause()
        {
            if (_IdleTask == null || !_Idling)
                return;
            CheckConnectionStatus();
            SendCommand("DONE");

            if (!_IdleTask.Wait(ServerTimeout)) {
                //Not responding
                Disconnect();
                ImapClientException e = new ImapClientException("Lost communication to IMAP server, connection closed.");
                ImapClientExceptionEventArgs args = new ImapClientExceptionEventArgs(e);
                Task.Factory.StartNew(() => ImapException.Fire(this, args));
            }
            _IdleTask.Dispose();
            _IdleTask = null;
        }