示例#1
0
        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));
        }
示例#2
0
 protected override object GetInvocationData(string method, object[] args)
 {
     return(new
     {
         Hub = _hubName,
         Method = method,
         Args = args,
         State = _state.GetChanges()
     });
 }
示例#3
0
 protected override ClientHubInvocation GetInvocationData(string method, object[] args)
 {
     return(new ClientHubInvocation
     {
         Hub = _hubName,
         Method = method,
         Args = args,
         Target = _signal,
         State = _state.GetChanges()
     });
 }
示例#4
0
        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);
        }
示例#5
0
        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));
        }
示例#6
0
        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));
        }
示例#7
0
        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);
        }