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;
}