20 internal readonly
string _spn;
62 : base(null,
state, callback)
125 connectAndHandshakeAsyncResult.
Handshake();
173 else if (connectAndHandshakeAsyncResult.
SendEHello())
179 if (connectAndHandshakeAsyncResult.
SendHello())
244 if (!connectAndHandshakeAsyncResult.
SendHello())
348 (connectAndHandshakeAsyncResult._connection._networkStream as
System.
Net.
TlsStream).EndAuthenticateAsClient(result);
371 if (credential ==
null)
376 if (authorization ==
null || authorization.
Message ==
null)
397 _connection._isConnected =
true;
402 _connection._isConnected =
true;
418 connectAndHandshakeAsyncResult._authResponse = lineInfo.
Line;
427 connectAndHandshakeAsyncResult._connection._isConnected =
true;
444 if (authorization ==
null)
457 _connection._isConnected =
true;
483 connectAndHandshakeAsyncResult._connection._isConnected =
true;
489 connectAndHandshakeAsyncResult._authResponse = lineInfo.
Line;
611 return connectAndHandshakeAsyncResult;
645 _tcpClient.LingerState =
new LingerOption(enable:
true, 0);
649 _tcpClient.Client.Blocking =
false;
733 if (credential ==
null)
738 if (authorization ==
null || authorization.
Message ==
null)
750 if (authorization ==
null)
774 if (executionContext !=
null)
778 return authenticateCallbackContext.
_result;
793 authenticateCallbackContext._result = authenticateCallbackContext.
_module.
Authenticate(
null, authenticateCallbackContext.
_credential, authenticateCallbackContext.
_thisPtr, authenticateCallbackContext.
_spn, authenticateCallbackContext.
_token);
817 foreach (
string text in extensions)
822 string[] array2 =
array;
823 foreach (
string a
in array2)
static NetworkCredential DefaultNetworkCredentials
object InternalWaitForCompletion()
void InvokeCallback(object result)
static LineInfo EndSend(IAsyncResult result)
static IAsyncResult BeginSend(SmtpConnection conn, string type, string message, AsyncCallback callback, object state)
static LineInfo Send(SmtpConnection conn, string type, string message)
static void Send(SmtpConnection conn)
static string[] Send(SmtpConnection conn, string domain)
static string[] EndSend(IAsyncResult result)
static IAsyncResult BeginSend(SmtpConnection conn, string domain, AsyncCallback callback, object state)
static void Send(SmtpConnection conn, string domain)
static void EndSend(IAsyncResult result)
static IAsyncResult BeginSend(SmtpConnection conn, string domain, AsyncCallback callback, object state)
static void Send(SmtpConnection conn)
readonly ChannelBinding _token
readonly NetworkCredential _credential
readonly ISmtpAuthenticationModule _module
readonly SmtpConnection _thisPtr
AuthenticateCallbackContext(SmtpConnection thisPtr, ISmtpAuthenticationModule module, NetworkCredential credential, string spn, ChannelBinding Token)
static void End(IAsyncResult result)
bool TlsStreamAuthenticate()
static void TlsStreamAuthenticateCallback(IAsyncResult result)
static void InitializeConnectionCallback(IAsyncResult result)
static void AuthenticateContinueCallback(IAsyncResult result)
readonly System.Net.ContextAwareResult _outerResult
bool AuthenticateContinue()
static void HandshakeCallback(IAsyncResult result)
static void SendHelloCallback(IAsyncResult result)
static void SendEHelloCallback(IAsyncResult result)
ConnectAndHandshakeAsyncResult(SmtpConnection connection, string host, int port, System.Net.ContextAwareResult outerResult, AsyncCallback callback, object state)
readonly SmtpConnection _connection
static void SendStartTlsCallback(IAsyncResult result)
static readonly AsyncCallback s_sendHelloCallback
static readonly AsyncCallback s_sendEHelloCallback
static void AuthenticateCallback(IAsyncResult result)
static readonly AsyncCallback s_handshakeCallback
static readonly AsyncCallback s_authenticateCallback
void InitializeConnection()
static readonly AsyncCallback s_authenticateContinueCallback
void OnClose(object sender, EventArgs args)
bool _serverSupportsStartTls
readonly ICredentialsByHost _credentials
static readonly ContextCallback s_AuthenticateCallback
SupportedAuth _supportedAuth
readonly BufferBuilder _bufferBuilder
SmtpReplyReaderFactory Reader
void ParseExtensions(string[] extensions)
SmtpConnection(SmtpTransport parent, SmtpClient client, ICredentialsByHost credentials, ISmtpAuthenticationModule[] authenticationModules)
IAsyncResult BeginInitializeConnection(string host, int port, AsyncCallback callback, object state)
readonly SmtpClient _client
void EndFlush(IAsyncResult result)
IAsyncResult BeginFlush(AsyncCallback callback, object state)
NetworkStream _networkStream
IAsyncResult BeginGetConnection(System.Net.ContextAwareResult outerResult, AsyncCallback callback, object state, string host, int port)
BufferBuilder BufferBuilder
readonly EventHandler _onCloseHandler
bool AuthSupported(ISmtpAuthenticationModule module)
Authorization SetContextAndTryAuthenticate(ISmtpAuthenticationModule module, NetworkCredential credential, System.Net.ContextAwareResult context)
SmtpReplyReaderFactory _responseReader
void GetConnection(string host, int port)
static void AuthenticateCallback(object state)
readonly ISmtpAuthenticationModule[] _authenticationModules
X509CertificateCollection _clientCertificates
static readonly char[] s_authExtensionSplitters
void ShutdownConnection(bool isAbort)
X509CertificateCollection ClientCertificates
void EndGetConnection(IAsyncResult result)
void InitializeConnection(string host, int port)
void EndInitializeConnection(IAsyncResult result)
Stream GetClosableStream()
SmtpStatusCode StatusCode
SmtpReplyReader CurrentReader
SmtpReplyReader GetNextReplyReader()
LineInfo EndReadLine(IAsyncResult result)
IAsyncResult BeginReadLine(AsyncCallback callback, object state)
static void Send(SmtpConnection conn)
static IAsyncResult BeginSend(SmtpConnection conn, AsyncCallback callback, object state)
static void EndSend(IAsyncResult result)
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
override void Write(byte[] buffer, int offset, int count)
override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
override void EndWrite(IAsyncResult asyncResult)
IAsyncResult BeginConnect(IPAddress address, int port, AsyncCallback? requestCallback, object? state)
virtual void Dispose(bool disposing)
NetworkStream GetStream()
void EndConnect(IAsyncResult asyncResult)
void Connect(string hostname, int port)
void AuthenticateAsClient()
static string SmtpAlreadyConnected
static string SmtpAuthenticationFailed
static string MailServerDoesNotSupportStartTls
static void Run(ExecutionContext executionContext, ContextCallback callback, object? state)
bool CompletedSynchronously
NetworkCredential? GetCredential(string host, int port, string authenticationType)
void CloseContext(object sessionCookie)
Authorization Authenticate(string challenge, NetworkCredential credentials, object sessionCookie, string spn, ChannelBinding channelBindingToken)
string AuthenticationType
delegate void ContextCallback(object? state)
SmtpStatusCode StatusCode