private void ClearInvocationCallbacks(string error) { var result = new HubResult(); result.Error = error; lock (_callbacks) { foreach (var callback in _callbacks.Values) { callback(result); } _callbacks.Clear(); } }