MailKit.Net.Imap.ImapClient.ReconnectAsync C# (CSharp) Метод

ReconnectAsync() публичный Метод

Asynchronously reconnect to the most recently connected IMAP server.

Asynchronously reconnects to the most recently connected IMAP server. Once a successful connection is made, the session will then be re-authenticated using the account name used in the previous session and the password.

/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// There is no previous session to restore. /// /// The operation was canceled via the cancellation token. /// /// Authentication using the supplied credentials has failed. /// /// A SASL authentication error occurred. /// /// The previous session was using the STARTTLS extension but the /// IMAP server no longer supports it. /// /// An I/O error occurred. /// /// An IMAP protocol error occurred. ///
public ReconnectAsync ( string password, CancellationToken cancellationToken = default(CancellationToken) ) : System.Threading.Task
password string The password.
cancellationToken System.Threading.CancellationToken The cancellation token.
Результат System.Threading.Task
		public Task ReconnectAsync (string password, CancellationToken cancellationToken = default (CancellationToken))
		{
			return Task.Factory.StartNew (() => {
				lock (SyncRoot) {
					Reconnect (password, cancellationToken);
				}
			}, cancellationToken, TaskCreationOptions.None, TaskScheduler.Default);
		}
#endif