private EndGetConnection ( IAsyncResult result ) : void | ||
result | IAsyncResult | |
Résultat | void |
private void ConnectCallback(IAsyncResult result) { if (NetEventSource.IsEnabled) { NetEventSource.Enter(this); } try { _transport.EndGetConnection(result); if (_cancelled) { Complete(null, result); } else { // Detected durring Begin/EndGetConnection, restrictable using DeliveryFormat bool allowUnicode = IsUnicodeSupported(); ValidateUnicodeRequirement(_message, _recipients, allowUnicode); _transport.BeginSendMail(_message.Sender ?? _message.From, _recipients, _message.BuildDeliveryStatusNotificationString(), allowUnicode, new AsyncCallback(SendMailCallback), result.AsyncState); } } catch (Exception e) { Complete(e, result); } finally { if (NetEventSource.IsEnabled) { NetEventSource.Exit(this); } } }
private void ConnectCallback(IAsyncResult result) { if (GlobalLog.IsEnabled) { GlobalLog.Enter("SmtpClient#" + LoggingHash.HashString(this) + "::ConnectCallback"); } try { _transport.EndGetConnection(result); if (_cancelled) { Complete(null, result); } else { // Detected durring Begin/EndGetConnection, restrictable using DeliveryFormat bool allowUnicode = IsUnicodeSupported(); ValidateUnicodeRequirement(_message, _recipients, allowUnicode); _transport.BeginSendMail(_message.Sender ?? _message.From, _recipients, _message.BuildDeliveryStatusNotificationString(), allowUnicode, new AsyncCallback(SendMailCallback), result.AsyncState); } } catch (Exception e) { Complete(e, result); } if (GlobalLog.IsEnabled) { GlobalLog.Leave("SmtpClient#" + LoggingHash.HashString(this) + "::ConnectCallback"); } }
private void ConnectCallback(IAsyncResult result) { try { SmtpTransport.EndGetConnection(result); if (_cancelled) { Complete(null, result.AsyncState !); } else { SendMailAsync(result.AsyncState !); } } catch (Exception e) { Complete(e, result.AsyncState !); } }
private void ConnectCallback(IAsyncResult result) { try { SmtpTransport.EndGetConnection(result); if (_cancelled) { Complete(null, result); } else { // Detected during Begin/EndGetConnection, restrictable using DeliveryFormat bool allowUnicode = IsUnicodeSupported(); ValidateUnicodeRequirement(_message !, _recipients !, allowUnicode); _transport.BeginSendMail(_message !.Sender ?? _message.From !, _recipients !, _message.BuildDeliveryStatusNotificationString(), allowUnicode, new AsyncCallback(SendMailCallback), result.AsyncState !); } } catch (Exception e) { Complete(e, result); } }