signalr-hub

SignalR: Error during negotiation request: undefined

佐手、 提交于 2019-11-28 09:29:30
问题 I've been trying to get a javascript signal-r client working against a self-hosted owin server. And am running into this issue. I've tried both proxies and no proxy methods both with the same result of the and error "SignalR: Error during negotiation request: undefined". I've been able to get the cross-domain sample to run without any issues and cannot figure out what I am doing wrong, anyone have any ideas? The browser console gets logs an attempt to negotiate then I get the failure. Server

How to configure Autofac and SignalR in a MVC 5 application

和自甴很熟 提交于 2019-11-28 09:13:57
问题 I am trying to configure an MVC 5 application to use SignalR 2.2.x and inject a service into my NotificationsHub . We are using Autofac for MVC but I am not sure on how to correctly configure this. Autofac documentation exists for NuGet Autofac.Integration.SignalR (3.0.2) and Autofac.Integration.Mvc (3.3.4) . What I am doing so far is register the hubs via: ContainerBuilder builder = new ContainerBuilder(); // Register MVC controllers. builder.RegisterControllers(typeof(MvcApplication)

SignalR JS Client Methods Not Invoked

这一生的挚爱 提交于 2019-11-28 07:44:31
问题 I'm having trouble getting SignalR server-side Hub code to invoke JS client methods. The reverse is working fine - so when my client sends a message to the server it is delivered as expected. I've been fairly careful to avoid obvious traps but I guess I'm still overlooking something. Here's my code: From MessageHub.cs: public bool SendMessage( ClientMessage message ) { ... Clients.All.addMessage("my message"); ... } Javascript: $.connection.hub.start() .done(function () { messageHub = $

SignalR serverSentEvents on Windows Server 2008 with IIS 7 POST request taking too much time to complete

六眼飞鱼酱① 提交于 2019-11-28 05:34:39
问题 I'm using SignalR 2.0.0-beta2 and it's behaving strangely in production environment where an ASP.NET MVC 5 [ .NET Framework 4.5 ] app is installed on Windows Server 2008 with IIS 7 . The AppPool is in Integrated Mode and only has this app. The GET request made by SignalR takes only 60 ms : http://mysite.org.br/signalr/negotiate?clientProtocol=1.3&_=1374377239338 The problem happens with the POST request that takes forever. In the most recent test right now it took incredible 3m 1s : http:/

How to get SignalR Hub Context in a ASP.NET Core?

こ雲淡風輕ζ 提交于 2019-11-28 04:41:43
I'm trying to get the context for a hub using the following: var hubContext = GlobalHost.ConnectionManager.GetHubContext<SomeHub>(); The problem is that GlobalHost is not defined. I see it is part of the SignalR.Core dll. At the moment, I have the following in my project .json file, under dependencies: "Microsoft.AspNet.SignalR.Server": "3.0.0-*" If I add the latest available version of Core: "Microsoft.AspNet.SignalR.Server": "3.0.0-*", "Microsoft.AspNet.SignalR.Core" : "2.1.2" I get a whole bunch of errors because server and core are conflicting. If I change them to both use version "3.0.0-*

When does a reconnect in signalR occur?

橙三吉。 提交于 2019-11-28 02:51:43
I've started working with SignalR and was trying to figure out when a Hub Reconnect occurs. I didn't find any satisfying explanation on the web. Can someone explain when/why a reconnect occurs? N. Taylor Mullen A hub reconnect occurs when a client goes offline then regains connectivity shortly after. SignalR configuration values largely determine the time stamps of the following examples so do not take the times verbatim. Here are several examples and their outcomes (time format m:ss) involving reconnecting behavior: When I Mention the following i am referring to the server side Hub method

Best practice for reconnecting SignalR 2.0 .NET client to server hub

喜夏-厌秋 提交于 2019-11-28 02:48:17
I'm using SignalR 2.0 with the .NET client in a mobile application which needs to handle various types of disconnects. Sometimes the SignalR client reconnects automatically - and sometimes it has to be reconnected directly by calling HubConnection.Start() again. Since SignalR magically auto-reconnects some of the time, I'm wondering if I'm missing a feature or config setting? What's the best way to set up a client that reconnects automatically? I've seen javascript examples that handle the Closed() event and then Connect after a n-seconds. Is there any recommended approach? I've read the

SignalR version compatability (StatusCode: 405 'Method Not Allowed')

僤鯓⒐⒋嵵緔 提交于 2019-11-28 01:57:56
I'm having issues with a SignalR project I'm currently working on. I'm trying to build a server using .Net Core, and a client using traditional .Net (framework 4.6.1). However the server and client don't seem to be compatible. The last issue I've run into is a StatusCode: 405, ReasonPhrase: 'Method Not Allowed'. I found an answer on GitHub that states that there are many breaking changes between versions. Looking at the NuGet package versions available, I get even more confused. for the .Net Core server I'm using 1.0.0-preview1-final. There's also a 1.0.0-alpha2-final available, but I have no

SignalR OnDisconnected - a reliable way to handle “User is Online” for chatroom?

那年仲夏 提交于 2019-11-27 20:01:57
问题 I'm implementing a chat room. So far, so good - users can send messages from their browsers via a JS client, and I can use a C# client to do the same thing - these messages get broadcast to other users. Now, I'm trying to implement "online users". My approach is the following: OnConnected - update the User in the db to be IsOnline = true OnDisconnected - if the User doesn't have any other connections, update the user in the db to be IsOnline = false I'm storing state in the DB because I have

Passing token through http Headers SignalR

巧了我就是萌 提交于 2019-11-27 18:20:56
I can see that there is an option in HubConnection to pass parameters through url request from client. Is there any way to pass specific token through http headers from JS or .NET clients? There is no easy way to set HTTP headers for SignalR requests using the JS or .NET client, but you can add parameters to the query string that will be sent as part of each SignalR request: JS Client $.connection.hub.qs = { "token" : tokenValue }; $.connection.hub.start().done(function() { /* ... */ }); .NET Client var connection = new HubConnection("http://foo/", new Dictionary<string, string> { { "token",