private Task ProcessResponse(TrackingDictionary state, object result, HubRequest request, Exception error) { var exception = error.Unwrap(); string stackTrace = (exception != null && _isDebuggingEnabled) ? exception.StackTrace : null; string errorMessage = exception != null ? exception.Message : null; if (exception != null) { _hubInvocationErrorsTotalCounter.SafeIncrement(); _hubInvocationErrorsPerSecCounter.SafeIncrement(); _allErrorsTotalCounter.SafeIncrement(); _allErrorsPerSecCounter.SafeIncrement(); } var hubResult = new HubResponse { State = state.GetChanges(), Result = result, Id = request.Id, Error = errorMessage, StackTrace = stackTrace }; return(_transport.Send(hubResult)); }
protected override object GetInvocationData(string method, object[] args) { return(new { Hub = _hubName, Method = method, Args = args, State = _state.GetChanges() }); }
protected override ClientHubInvocation GetInvocationData(string method, object[] args) { return(new ClientHubInvocation { Hub = _hubName, Method = method, Args = args, Target = _signal, State = _state.GetChanges() }); }
private void ProcessResult(TrackingDictionary state, object result, HubRequest request, Exception error) { var hubResult = new HubResult { State = state.GetChanges(), Result = result, Id = request.Id, Error = error != null?error.GetBaseException().Message : null }; Send(hubResult); }
private Task InvokeWithState(string method, object[] args) { string signal = _hubName + "." + _signal; var invocation = new { Hub = _hubName, Method = method, Args = args, State = _state.GetChanges() }; return(_connection.Broadcast(signal, invocation)); }
private Task ProcessResponse(TrackingDictionary state, object result, HubRequest request, Exception error) { var exception = error.Unwrap(); string stackTrace = (exception != null && _isDebuggingEnabled) ? exception.StackTrace : null; string errorMessage = exception != null ? exception.Message : null; var hubResult = new HubResponse { State = state.GetChanges(), Result = result, Id = request.Id, Error = errorMessage, StackTrace = stackTrace }; return(_transport.Send(hubResult)); }
private Task ProcessResult(TrackingDictionary state, object result, HubRequest request, Exception error) { var hubResult = new HubResult { State = state.GetChanges(), Result = result, Id = request.Id, Error = error != null ? error.GetBaseException().Message : null }; return Send(hubResult); }