Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SendEHelloCallback()

static void System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.SendEHelloCallback ( IAsyncResult result)
inlinestaticprivate

Definition at line 219 of file SmtpConnection.cs.

220 {
221 if (result.CompletedSynchronously)
222 {
223 return;
224 }
225 ConnectAndHandshakeAsyncResult connectAndHandshakeAsyncResult = (ConnectAndHandshakeAsyncResult)result.AsyncState;
226 try
227 {
228 try
229 {
230 connectAndHandshakeAsyncResult._connection._extensions = EHelloCommand.EndSend(result);
231 connectAndHandshakeAsyncResult._connection.ParseExtensions(connectAndHandshakeAsyncResult._connection._extensions);
232 if (connectAndHandshakeAsyncResult._connection._networkStream is System.Net.TlsStream)
233 {
234 connectAndHandshakeAsyncResult.Authenticate();
235 return;
236 }
237 }
238 catch (SmtpException ex)
239 {
240 if (ex.StatusCode != SmtpStatusCode.CommandUnrecognized && ex.StatusCode != SmtpStatusCode.CommandNotImplemented)
241 {
242 throw;
243 }
244 if (!connectAndHandshakeAsyncResult.SendHello())
245 {
246 return;
247 }
248 }
249 if (connectAndHandshakeAsyncResult._connection.EnableSsl)
250 {
251 if (!connectAndHandshakeAsyncResult._connection._serverSupportsStartTls && !(connectAndHandshakeAsyncResult._connection._networkStream is System.Net.TlsStream))
252 {
253 throw new SmtpException(System.SR.MailServerDoesNotSupportStartTls);
254 }
255 connectAndHandshakeAsyncResult.SendStartTls();
256 }
257 else
258 {
259 connectAndHandshakeAsyncResult.Authenticate();
260 }
261 }
262 catch (Exception result2)
263 {
264 connectAndHandshakeAsyncResult.InvokeCallback(result2);
265 }
266 }
ConnectAndHandshakeAsyncResult(SmtpConnection connection, string host, int port, System.Net.ContextAwareResult outerResult, AsyncCallback callback, object state)
static string MailServerDoesNotSupportStartTls
Definition SR.cs:168
Definition SR.cs:7

References System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.ConnectAndHandshakeAsyncResult(), System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult._connection, System.Net.Mail.SmtpConnection._extensions, System.Net.Mail.SmtpConnection._networkStream, System.Net.Mail.SmtpConnection._serverSupportsStartTls, System.IAsyncResult.AsyncState, System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.Authenticate(), System.IAsyncResult.CompletedSynchronously, System.Net.Mail.SmtpConnection.EnableSsl, System.Net.Mail.EHelloCommand.EndSend(), System.Net.LazyAsyncResult.InvokeCallback(), System.SR.MailServerDoesNotSupportStartTls, System.Net.Mail.SmtpConnection.ParseExtensions(), System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.SendHello(), System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.SendStartTls(), and System.Net.Mail.SmtpException.StatusCode.