in src/NMS.AMQP/NmsConnection.cs [276:312]
public void OnConnectionFailure(NMSException exception)
{
Interlocked.CompareExchange(ref failureCause, exception, null);
OnAsyncException(exception);
if (!closed)
{
try
{
provider?.Close();
}
catch (Exception error)
{
Tracer.Error($"Error while closing failed Provider: {error.Message}");
}
connected.Set(false);
try
{
foreach (NmsSession session in sessions.Values.ToArray())
{
session.Shutdown(exception);
}
}
catch (NMSException e)
{
Tracer.Error($"Exception during connection cleanup, {e}");
}
foreach (INmsConnectionListener listener in connectionListeners)
{
listener.OnConnectionFailure(exception);
}
}
}