System.Net.Mail.SmtpConnection.Abort C# (CSharp) Method

Abort() private method

private Abort ( ) : void
return void
        internal void Abort()
        {
            if (!_isClosed)
            {
                lock (this)
                {
                    if (!_isClosed && _tcpClient != null)
                    {
                        //free CBT buffer
                        if (_channelBindingToken != null)
                        {
                            _channelBindingToken.Close();
                        }

                        // must destroy manually since sending a QUIT here might not be 
                        // interpreted correctly by the server if it's in the middle of a
                        // DATA command or some similar situation.  This may send a RST
                        // but this is ok in this situation.  Do not reuse this connection
                        _tcpClient.LingerState = new LingerOption(true, 0);
                        _networkStream.Close();
                        _tcpClient.Dispose();
                    }
                    _isClosed = true;
                }
            }
            _isConnected = false;
        }

Usage Example

Esempio n. 1
0
 internal void Abort()
 {
     if (_connection != null)
     {
         _connection.Abort();
     }
 }
All Usage Examples Of System.Net.Mail.SmtpConnection::Abort