signalr

Call a SignalR method from a different AppDomain

别等时光非礼了梦想. 提交于 2019-12-24 10:34:33
问题 I have a working web server written in C# using SignalR. It's a self-hosted Owin Application. Everything works fine. Now I have to relocate my controllers in different AppDomains. This breaks the SignalR part, because GlobalHost remains the same only within one AppDomain, and is not serializable (thus I can't pass it along to other AppDomains as it is). I've found a lot of examples/questions/tutorials about calling SignalR hubs methods from a Controller/an other class/whatever, but nothing

SignalR Client Application fails to connect when running in VS2008

家住魔仙堡 提交于 2019-12-24 10:23:36
问题 I have a sample SignalR JQuery client application which is almost identical to the GitHub JQuery example. If I run the application via VS2008, I get the following error: "SignalR: Connection must be started before data can be sent. Call .start() before .send()" If I run the client app from the browser as in: http://localhost/SignalRClient, I get everything working as expected. Any suggestions on how I can run the client with Visual Studio? <div> <script type="text/javascript"> $(function() {

Client Reconnection

假装没事ソ 提交于 2019-12-24 09:59:32
问题 My understanding of the (JavaScript) hub client is that if a connection is lost, it enters a 'Reconnecting...' phase which attempts to reconnect. If it can't do so, it will enter a 'Disconnected' state which is where it'll stay until asked to start again. How long is the 'Reconnecting...' phase meant to last before it gives up? I've read 40 seconds before, but my client seems to take much less time - about 10, maybe less. [ EDIT: Nevermind this part, I had configured a 10 disconnect on the

SignalR: worker process is limited to 10 concurrent requests

寵の児 提交于 2019-12-24 09:32:26
问题 I've deployed a SignalR-based app onto my on-premises server, and it is crashing when there are more than ten concurrent users. The long-running requests for the worker process associated with my app pool all have URLs of the form /signalr/reconnect?transport=serverSentEvents&connectionToken=... . As soon as more than ten users connect, the limit of ten concurrent requests is breached and the application hangs. Do I need to change any IIS settings to allow SignalR to scale in this instance?

SignalR - how to detect client connect/reconnect failure (e.g. timeout)

南楼画角 提交于 2019-12-24 08:09:45
问题 How do I detect when a client is failing to connect (or re-connect) to a Signalr hub? Is there an event that fires on the js client? 回答1: Responding to your second comment: Currently in 0.5.3 SignalR does not handle the case when the server goes away. However, this will be/is handled in the next release 1.0alpha. For the interim I'd recommend pinging the server every 5 seconds and seeing if the request fails. If it fails say 2 times then chances are the server is down and you can handle the

SignalR combined with load balancer missing messages

柔情痞子 提交于 2019-12-24 07:58:47
问题 I have 2 web servers (IIS 8.5) behind a hardware firewall and our application uses SignalR for some real-time updates. We are using SQL Server as the backplane to help us work in this load balanced environment. Additionally we are using sticky sessions on the load balancer to help us keep the users on the same web server during their session. When we are running in this hardware configuration we lose at least 1/3 of our messages. Sometimes we get all the expected messages but more often than

How to validate Azure AD B2C token from query string in Asp.net Core?

我是研究僧i 提交于 2019-12-24 07:26:18
问题 I have a asp.net web api application with some controllers and a signalR hub. JWT tokens validation with Azure AD B2C is configured like this: services.AddAuthentication(AzureADB2CDefaults.JwtBearerAuthenticationScheme) .AddAzureADB2CBearer(options => _configuration.Bind("AzureAdB2C", options)) This works fine with controllers, and I don't have to worry about the intricacies of Azure AD B2C token validation. Now, for the signalR hub to support Web Sockets or Server-sent events, the

Wait() causes UI thread to hang - when should Wait() be used?

我们两清 提交于 2019-12-24 05:39:14
问题 I have the following code that connects to a SignalR Hub private static async Task StartListening() { try { var hubConnection = new HubConnection("http://localhost:8080/"); IHubProxy hubProxy = hubConnection.CreateHubProxy("Broadcaster"); hubProxy.On<EventData>("notifyCardAccessEvent", eventData => { Log.Info(string.Format("Incoming data: {0} {1}", eventData.Id, eventData.DateTime)); }); ServicePointManager.DefaultConnectionLimit = 10; await hubConnection.Start(); Log.Info("Connected"); }

Can SignalR be used without a web browser client?

房东的猫 提交于 2019-12-24 05:19:21
问题 I'm working on a project to front an asynchronous process with a synchronous front-end to make the web call appear as synchronous, and am exploring the use of SignalR to tie it all together. We host a service with a WCF endpoint which is asynchronous, and that works for most of our clients. They send us data, and we process it, without them getting a response after that data is processed. Our environment is multi-tier, and asynchronous by design. There is a need, however, to host a

SignalR connection request does not send cookies

六月ゝ 毕业季﹏ 提交于 2019-12-24 04:01:37
问题 I am building a web application using ASP.NET Web API and SignalR. I have a pretty good understanding of HTTP but this problem is beyond me. Currently, I am setting a cookie on all AJAX requests to this API. Subsequent AJAX requests to the API send the cookie without issue. However, I would like this cookie to also be used in the SignalR requests that establish a connection, but according to Chrome, the cookie is not being sent in these requests. I have the cookie set as HTTPOnly. Currently,