System.Net.Mail.SmtpTransport.EndGetConnection C# (CSharp) Method

EndGetConnection() private method

private EndGetConnection ( IAsyncResult result ) : void
result IAsyncResult
return void
        internal void EndGetConnection(IAsyncResult result)
        {
            if (NetEventSource.IsEnabled) NetEventSource.Enter(this);
            try
            {
                _connection.EndGetConnection(result);
            }
            finally
            {
                if (NetEventSource.IsEnabled) NetEventSource.Exit(this);
            }
        }

Usage Example

Example #1
0
 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);
         }
     }
 }
All Usage Examples Of System.Net.Mail.SmtpTransport::EndGetConnection