public async void OnRequestReceived(SignalRRequest request) { m_serverLogger.LogInfo(string.Format("New request received: {0}", request.TypeName)); var handler = m_requestHandlerFactoryFactory.GetHandlerFor(request.TypeName); if (handler == null) { m_serverLogger.LogError(string.Format("No RequestHandler found for {0}", request.TypeName)); return; } AddContextToRequestHandler(handler); if (!handler.IsAuthorized()) { m_serverLogger.LogWarning(string.Format("Request not authorized, Request: {0}, ConnectionId: {1}", request.TypeName, Context.ConnectionId)); Clients.Caller.OnResponse(new SignalRResponse { RequestId = request.RequestId, Aborted = true }); return; } m_serverLogger.LogInfo(string.Format("Executing request: {0}", request.TypeName)); var response = await handler.ExecuteAsync(request); m_serverLogger.LogInfo(string.Format("Request executed: {0}", request.TypeName)); Clients.Caller.OnResponseReceived(response); }