• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class ImapIdleSession

Represents an active IMAP IDLE session (RFC 2177). Created by StartIdle(). The session runs a background thread that reads server-pushed untagged responses and raises events. Callers must marshal event handlers to their own thread. To issue any other command on the ImapClient, call Stop() (or Dispose()) first.

Inheritance
object
ImapIdleSession
Implements
IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Mail.Rfc.Imap
Assembly: DRIT.Mail.dll
Syntax
public sealed class ImapIdleSession : IDisposable

Properties

View Source

IsActive

Gets a value indicating whether the IDLE session is still running (the background thread is alive and Stop() has not been called).

Declaration
public bool IsActive { get; }
Property Value
Type Description
bool

Methods

View Source

Dispose()

Stops the session (if still active) and releases resources.

Declaration
public void Dispose()
View Source

Stop()

Stops the IDLE session by sending DONE, waiting for the tagged OK, and joining the background thread. Safe to call multiple times.

Declaration
public void Stop()

Events

View Source

Error

Raised when the transport or protocol encounters an error during IDLE. After this event fires, the session is no longer active.

Declaration
public event EventHandler<ImapIdleErrorEventArgs>? Error
Event Type
Type Description
EventHandler<ImapIdleErrorEventArgs>
View Source

FlagsChanged

Raised when the server reports a flag change on a message (* N FETCH (FLAGS (...))).

Declaration
public event EventHandler<ImapFlagsChangedEventArgs>? FlagsChanged
Event Type
Type Description
EventHandler<ImapFlagsChangedEventArgs>
View Source

MessageArrived

Raised when the server reports a new message count (* N EXISTS, where the count increased).

Declaration
public event EventHandler<ImapExistsEventArgs>? MessageArrived
Event Type
Type Description
EventHandler<ImapExistsEventArgs>
View Source

MessageExpunged

Raised when the server reports a message was permanently removed (* N EXPUNGE).

Declaration
public event EventHandler<ImapExpungeEventArgs>? MessageExpunged
Event Type
Type Description
EventHandler<ImapExpungeEventArgs>
View Source

RecentChanged

Raised when the server reports a new recent-message count (* N RECENT).

Declaration
public event EventHandler<ImapRecentEventArgs>? RecentChanged
Event Type
Type Description
EventHandler<ImapRecentEventArgs>

Implements

IDisposable
  • View Source
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX