GetConnection() private method

private GetConnection ( string host, int port ) : void
host string
port int
return void
Exemplo n.º 1
0
        internal void GetConnection(string host, int port)
        {
            try
            {
                lock (this)
                {
                    _connection = new SmtpConnection(this, _client, _credentials, _authenticationModules);
                    if (_shouldAbort)
                    {
                        _connection.Abort();
                    }
                    _shouldAbort = false;
                }

                if (NetEventSource.IsEnabled)
                {
                    NetEventSource.Associate(this, _connection);
                }

                if (EnableSsl)
                {
                    _connection.EnableSsl          = true;
                    _connection.ClientCertificates = ClientCertificates;
                }

                _connection.GetConnection(host, port);
            }
            finally { }
        }
Exemplo n.º 2
0
        internal void GetConnection(string host, int port)
        {
            try
            {
                _connection         = new SmtpConnection(this, _client, _credentials, _authenticationModules);
                _connection.Timeout = _timeout;
                if (MailEventSource.Log.IsEnabled())
                {
                    MailEventSource.Log.Associate(this, _connection);
                }

                if (EnableSsl)
                {
                    _connection.EnableSsl          = true;
                    _connection.ClientCertificates = ClientCertificates;
                }

                _connection.GetConnection(host, port);
            }
            finally { }
        }
        internal void GetConnection(ServicePoint servicePoint)
        {
            try {
                Debug.Assert(servicePoint != null, "no ServicePoint provided by SmtpClient");
                // check to see if we have a different connection than last time
                UpdateServicePoint(servicePoint);
                connection         = new SmtpConnection(this, client, credentials, authenticationModules);
                connection.Timeout = timeout;
                if (Logging.On)
                {
                    Logging.Associate(Logging.Web, this, connection);
                }

                if (EnableSsl)
                {
                    connection.EnableSsl          = true;
                    connection.ClientCertificates = ClientCertificates;
                }
                connection.GetConnection(servicePoint);
            }
            finally {
            }
        }
Exemplo n.º 4
0
 internal void GetConnection(ServicePoint servicePoint)
 {           
     try {
         Debug.Assert(servicePoint != null, "no ServicePoint provided by SmtpClient");
         // check to see if we have a different connection than last time
         UpdateServicePoint(servicePoint);
         connection = new SmtpConnection(this, client, credentials, authenticationModules);
         connection.Timeout = timeout;
         if(Logging.On)Logging.Associate(Logging.Web, this, connection);
         
         if (EnableSsl)
         {
             connection.EnableSsl = true;
             connection.ClientCertificates = ClientCertificates;
         }
         connection.GetConnection(servicePoint);
     }
     finally {
         
     }
 }
Exemplo n.º 5
0
        internal void GetConnection(string host, int port)
        {
            try
            {
                _connection = new SmtpConnection(this, _client, _credentials, _authenticationModules);
                _connection.Timeout = _timeout;
                if (MailEventSource.Log.IsEnabled()) MailEventSource.Log.Associate(this, _connection);

                if (EnableSsl)
                {
                    _connection.EnableSsl = true;
                    _connection.ClientCertificates = ClientCertificates;
                }

                _connection.GetConnection(host, port);
            }
            finally { }
        }