Step() public méthode

Sends the next part of the command to the server.
/// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// An IMAP protocol error occurred. ///
public Step ( ) : bool
Résultat bool
Exemple #1
0
        /// <summary>
        /// Iterate the command pipeline.
        /// </summary>
        public int Iterate()
        {
            if (stream == null)
                throw new InvalidOperationException ();

            if (queue.Count == 0)
                return 0;

            current = queue[0];
            queue.RemoveAt (0);

            try {
                current.CancellationToken.ThrowIfCancellationRequested ();
            } catch (OperationCanceledException) {
                // FIXME: is this right??
                queue.RemoveAll (x => x.CancellationToken == current.CancellationToken);
                throw;
            }

            current.Status = ImapCommandStatus.Active;

            try {
                while (current.Step ()) {
                    // more literal data to send...
                }

                if (current.Bye)
                    Disconnect ();
            } catch {
                Disconnect ();
                throw;
            }

            return current.Id;
        }
Exemple #2
0
        /// <summary>
        /// Iterate the command pipeline.
        /// </summary>
        public int Iterate()
        {
            if (Stream == null)
                throw new InvalidOperationException ();

            if (queue.Count == 0)
                return 0;

            current = queue[0];
            queue.RemoveAt (0);

            try {
                current.CancellationToken.ThrowIfCancellationRequested ();
            } catch {
                queue.RemoveAll (x => x.CancellationToken.IsCancellationRequested);
                current = null;
                throw;
            }

            current.Status = ImapCommandStatus.Active;

            int id = current.Id;

            try {
                while (current.Step ()) {
                    // more literal data to send...
                }

                if (current.Bye)
                    Disconnect ();
            } catch {
                Disconnect ();
                throw;
            } finally {
                current = null;
            }

            return id;
        }