Skip to content

Commit

Permalink
Bump the ConnectionsDisconnected PC even when OnDisconnected throws
Browse files Browse the repository at this point in the history
  • Loading branch information
halter73 committed Jul 22, 2014
1 parent 00c2455 commit b24ed8a
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -283,8 +283,13 @@ private Task Abort(bool clean)
var disconnectTask = Disconnected != null ? Disconnected(clean) : TaskAsyncHelper.Empty;

// Ensure delegate continues to use the C# Compiler static delegate caching optimization.
return disconnectTask.Catch((ex, state) => OnDisconnectError(ex, state), Trace)
.Then(counters => counters.ConnectionsDisconnected.Increment(), _counters);
return disconnectTask
.Catch((ex, state) => OnDisconnectError(ex, state), Trace)
.Finally(state =>
{
var counters = (IPerformanceCounterManager)state;
counters.ConnectionsDisconnected.Increment();
}, _counters);
}

public void ApplyState(TransportConnectionStates states)
Expand Down

0 comments on commit b24ed8a

Please sign in to comment.