signalr

SignalR: How to truly call a hub's method from the server / C#

这一生的挚爱 提交于 2019-12-20 17:30:18
问题 I'm trying to improve my application which will require calling a hub from C# instead of javascript. The current workflow for adding a task in my app is: make an API call to add the data to the database return new record to AngularJS controller invoke hub's method from controller hub broadcasts call to clients appropriately What I would like to do is bypass calling the hub's method from my AngularJS controller and call it directly from my API controller method. This is what my hub currently

Android app did not receive data from SignalR hub

假装没事ソ 提交于 2019-12-20 14:07:24
问题 I already read these topics: how to use SignalR in Android Android Client doesn't get data but .net client getting data from SignalR server I write a simple chat system with Android that works with SignalR. It is supposed to the clients send messages (by calling SendMessage method on the server) and the server should call the NewMessage method on the clients. Here is my ChatHub class (simplified) written in C#. public class ChatHub : Hub { // Store the clients connections Id static readonly

Building a SignalR / Knockout dashboard with guaranteed messaging

风流意气都作罢 提交于 2019-12-20 12:36:29
问题 I'm looking into replacing a monitoring dashboard at our company using real-time messaging. The Old Concept: At our company we have a dashboard that displays the (rather detailed) status of over 700 physical machines, plus added meta-information. It was built about 1,5 years ago by a colleague of mine in ASP.NET Web Forms (which I don't like) to enable dispatchers to coordinate where our technicians should go to fix problems (the machines are located in various geographical locations).

Using SignalR in Azure Worker Roles

≯℡__Kan透↙ 提交于 2019-12-20 12:16:15
问题 I have an Azure hosted web application which works alongside a number of instances of a worker role. Currently the web app passes work to these workers by placing messages in an Azure queue for the workers to pick up. The workers pass status and progress messages back by placing messages into a 'feedback' queue. At the moment, in order to inform my browser clients as to progress, I make ajax based periodic polling calls in the browser to an MVC controller method which in turn reads the Azure

SignalR / Websockets connection limitations and best practices

↘锁芯ラ 提交于 2019-12-20 11:55:25
问题 I'm trying to understand how to best design an IIS/ASP.NET based websocket application, specifically regarding concurrency limitations. I've read all the literature on IIS/ASP.NET regarding "concurrent Websocket connections" and how to tweak the various values - however, when speaking about websockets, what is the definition of "concurrent"? If I have opened a websocket and its sitting idle, is that "using" a connection? Do idle websockets count towards connection usage totals, or does it

Unittest SignalR Hubs

别等时光非礼了梦想. 提交于 2019-12-20 10:27:48
问题 I Would like to test my Hub in SignalR, what is the best approach? Possible solutions I have thought about so far: Create a testable Hub Abstract logic to separate class Selenium (would like to test smaller units) Or is it some SignalR testing features have overlooked Currently using SignalR 0.4, and NUnit as the testing framework. 回答1: This link shows how to unit test SignalR hub methods using Moq. You mock up the respository, clients, context, and the caller. Here's the code from the site,

SignalR - Set ClientID Manually

折月煮酒 提交于 2019-12-20 09:53:55
问题 I want to be able to have individual users send messages to each other using SignalR, therefore I need to send to a Specific Client ID. How can I define the client ID for a specific user at the start of the session - say a GUID Primary Key for the user? 回答1: Replace the IConnectionIdFactory with your own https://github.com/SignalR/SignalR/wiki/Extensibility. Sample usage: http://www.kevgriffin.com/maintaining-signalr-connectionids-across-page-instances/ EDIT : This is no longer supported in

Any samples for mvc6 with signalr?

橙三吉。 提交于 2019-12-20 09:17:44
问题 I have a full-working ASP.NET MVC application (.NET Core, ASP.NET MVC 6) . I would now like to add a signalr to my application. Any samples for MVC with signalr ? 回答1: The MusicStore sample on GitHub use signalR and the BugTracker sample also and you have a sample in the SignalR-Server repo Or you can look at my sample on GitHub 回答2: I don't believe there are any yet. The next version of SignalR, version 3, is designed for ASP.NET Core, SignalR 2 doesn't support this. If you look on the ASP

Ignore persistent SignalR connections in New Relic

我只是一个虾纸丫 提交于 2019-12-20 09:12:27
问题 Where should I call NewRelic.Api.Agent.NewRelic.IgnoreApdex() or NewRelic.Api.Agent.NewRelic.IgnoreTransaction() in my SignalR hubs to prevent long-running persistent connections from overshadowing my application monitoring logs? 回答1: Oooh, great question and one I hadn't thought about yet myself. I think what you would have to do is write a custom module, since modules execute before all handlers, that detect that the SignalR AspNetHandler handler is the one being requested and, if so, call

Web API / OWIN, SignalR & Authorization

天大地大妈咪最大 提交于 2019-12-20 08:10:52
问题 I am developing a prototype of an AngularJS, Web API, SignalR application as a potential starting point for a new project in VS 2013. At this stage, I'm pretty much using the canned code that visual studio generates for Individual User Accounts. There's a line in the StartUp.Auth.cs code that looks like this. app.UseOAuthBearerTokens(OAuthOptions); With this in place, I can add the [Authorize] attribute to controllers and it works fine. Incidentally, with angular I was able to add a standard