-
Notifications
You must be signed in to change notification settings - Fork 616
Closed
Description
Split from #512 .
The Connection class exposes events that it never fires - RecoverySucceeded and ConnectionRecoveryError. It seems these events are defined in Connection because they're part of the IConnection interface, which seems to define these events on behalf of AutorecoveringConnection.
As an example, here are all of the callsites to the RecoverySucceeded event and its backing field:
public event EventHandler<EventArgs> RecoverySucceeded
{
add
{
lock (m_eventLock)
{
m_recoverySucceeded += value;
}
}
remove
{
lock (m_eventLock)
{
m_recoverySucceeded -= value;
}
}
}
private void Dispose(bool disposing)
{
...
m_recoverySucceeded = null;
...
}
Since the events are never fired from within Connection, but they need to be implemented by Connection to meet the IConnection interface, the events should be replaced with empty add-remove handlers, and all backing fields should be removed.
public event EventHandler<EventArgs> RecoverySucceeded
{
add { }
remove { }
}
public event EventHandler<ConnectionRecoveryErrorEventArgs> ConnectionRecoveryError
{
add { }
remove {}
}