System.Net.FtpWebRequest.AttemptedRecovery C# (CSharp) Method

AttemptedRecovery() private method

Returns true if we should restart the request after an error

private AttemptedRecovery ( Exception e ) : bool
e Exception
return bool
        private bool AttemptedRecovery(Exception e)
        {
            if (e is OutOfMemoryException
                || _onceFailed
                || _aborted
                || _timedOut
                || _connection == null
                || !_connection.RecoverableFailure)
            {
                return false;
            }
            _onceFailed = true;

            lock (_syncObject)
            {
                if (_connection != null)
                {
                    _connection.CloseSocket();
                    if (NetEventSource.IsEnabled) NetEventSource.Info(this, $"Releasing connection: {_connection}");
                    _connection = null;
                }
                else
                {
                    return false;
                }
            }
            return true;
        }