signalr

SignalR is slow to connect from javascript client

假如想象 提交于 2019-12-06 06:14:24
问题 It sometimes takes a second or more to connect to my SignalR server from the browser - even when running locally. I thought websockets were supposd to be fast! 回答1: There is a configuration option to tell SignalR JS client to wait until the page load event is complete before sending anything. Just set waitForPageLoad: false in the startup options to prevent this happening. Of course you must make sure that anything you do in the callback can be executed safely if the page isn't loaded.

SignalR Broadcast Intercept Using Pipeline Module

依然范特西╮ 提交于 2019-12-06 06:05:00
I have created a setup where I have a back-end service that is broadcasting messages using SignalR through a SQL backplane and clients are receiving the messages through a MVC 5 + SignalR web application on a web farm. I want to intercept the messages before they get to the client from the web application and make some changes to the message, specifically return HTML to the client instead of the raw data. I have been able to achieve this in a development environment where the messages originate from the web application (not farmed) adding a HubPipelineModule class with an OnBeforeOutgoing

How to use debounceTime but still trigger the function after certain time?

本小妞迷上赌 提交于 2019-12-06 05:52:47
问题 TLDR; I would like to use debounceTime to execute the function only if 300 milliseconds have passed without it being called. In the meanwhile, I also want to be able to trigger the function every 1 minutes If the process takes a long time. Otherwise, the function will only be triggered at the end of the process. Basically, our system has a long process that will fire a lot of SignalR update to the client. When I received the server command on the client, I will make 2 additional HTTP requests

Can I reduce the Circular Buffer to “1”? Is that a good idea?

匆匆过客 提交于 2019-12-06 05:39:44
问题 By default, there are a default of 1,000 messages stored in the ring buffer on the server. It doesn't make sense for me to send a lagging client 1,000 updates, but rather just the most recent update. In WCF I can do this by using volatile data. I suppose I can emulate a volatile approach by reducing the buffer to "1", but not sure if this can be configured on a per hub basis, or ideally, on a per method basis. Does it matter if I use hubs or persistent connections with this? 回答1: Even if you

SignalR scaleout in Azure for high frequency scenario

醉酒当歌 提交于 2019-12-06 05:28:12
From my reading on SignalR scaleout in Azure, the recommended way is to use Azure ServiceBus as a backplane. But in the same time there is limitation on using backplane for high frequency messaging. In terms of Limitation chapter in Scaleout in SignalR , I would characterize my app as something between chat and real-time game. Any tips how to implement SignalR scaleout (in Azure) for this? You can set the # of topics (queues) that you use to increase throughput and scale up 来源: https://stackoverflow.com/questions/18150865/signalr-scaleout-in-azure-for-high-frequency-scenario

Using SignalR in a Website Project

微笑、不失礼 提交于 2019-12-06 05:26:21
问题 I'm trying a very simple demo of SignalR but getting the infamous "undefined" error on the following line in my javascript: var myHub = $.connection.myHub; MyHub.cs is as follows: public class MyHub : Hub { ... } Most of the examples I've seen so far are MVC or web application projects. With those, MyHub.cs would be placed in the App_Code folder. However, our project is a website project and we can't change it to a web application. What can I do to make it work? 回答1: It turned out that I

Why Context.User.Identity.Name is null in Windows Form Hub Context?

人盡茶涼 提交于 2019-12-06 05:06:55
I need to pass User.Identity.Name to Windows Form client. Method public override Task OnConnected() { string userName = Context.User.Identity.Name; string connectionId = Context.ConnectionId; var user = Users.GetOrAdd(userName, _ => new User { Name = userName, ConnectionIds = new HashSet<string>() }); lock (user.ConnectionIds) { user.ConnectionIds.Add(connectionId); if (user.ConnectionIds.Count == 1) { Clients.Others.userConnected(userName); } } return base.OnConnected(); } But Context.User.Identity.Name is null? Why? How to solve it? It looks like you are trying to get the username when

Enabling Authentication with SIgnalR against Azure Mobile Services and a Javascript client

非 Y 不嫁゛ 提交于 2019-12-06 05:04:59
I am having a heck of a time trying to figure out how one is supposed to have AMS authentication with SignalR while using a JavaScript client. I downloaded the JavaScript client for Azure Mobile Services, I've got Signal R on AMS - that's all hooked up and ready to go. I've got the authentication setup. I can actually call .login("microsoftaccount") on the AMS JS client and go through that process and get back a token and id. What I don't know is how to connect the two. I tried just calling $.connection.hub.Start() - it gives me 401. I tried putting the token in the query string, again it

signalR generating different ID for various instances

邮差的信 提交于 2019-12-06 04:11:43
问题 I have created web chat application using signalR. When user is logged in, user can open only 3-4 tabs and each time different connection ID is generated. I want that when we open new tab or refresh the page new connection id should not be generated. I want to use the existing connection id. For that I tried to implement the LocalStorage variable to store the hub connection. But Problem is i am unable to parse the value of localstorage variable. Can Anyone give me the solution to my problem

Is there any ASP.NET application to monitor online user and page view log report?

跟風遠走 提交于 2019-12-06 04:11:38
问题 I've recently seen ElmahR which is very useful to monitor the application's exceptions. Is there any application like ElmahR to monitor online users and trace the user navigation. I've seen some usefull reports in Site Log module in DNN, but I want to use a stand-alone application to monitor online users and get page view reports for any asp.net application. 回答1: something like real time analytics? http://analytics.blogspot.com/2011/09/whats-happening-on-your-site-right-now.html I think you