GetConnection() private method

private GetConnection ( string host, int port ) : void
host string
port int
return void
コード例 #1
0
ファイル: SmtpTransport.cs プロジェクト: lateralusX/runtime
        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 { }
        }
コード例 #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 { }
        }
コード例 #3
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 {
            }
        }
コード例 #4
0
ファイル: SmtpTransport.cs プロジェクト: REALTOBIZ/mono
 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 {
         
     }
 }
コード例 #5
0
ファイル: SmtpTransport.cs プロジェクト: naamunds/corefx
        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 { }
        }