signalr-hub

SignalR .Net client fails to connect (upd: how to set auth. cookie?)

孤街醉人 提交于 2019-12-11 11:43:17
问题 This thing is dragging me nuts. I have a .net 4.0 console app and I have an MVC web app. javascript clients can connect and talk to the server - no problems here... but my .net client throws System.AggregateException with InnerException = "Unexpected character encountered while parsing value: <. Path... so I created an empty MVC3 app, added SignalR libraries, and .net client surprisingly connects to that. But for some reason it doesn't to the other one. I've checked everything, both MVC3 apps

404:signalr/hubs for signalR chat application

爱⌒轻易说出口 提交于 2019-12-11 11:08:40
问题 I am trying to create a chat application using signalR using VS2012 web in a website. But its showing me error like this: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:50780/WebApplication1/WebApplication1/signalr/hubs Uncaught TypeError: Cannot read property 'client' of undefined I have added RouteTable.Routes.MapHubs(); to Global.asax But why should its showing me this error when its opening for other's system. 回答1: On the page where you're

Refreshing List of news using SignalR

元气小坏坏 提交于 2019-12-11 06:51:27
问题 I have an asp.net MVC 4.0 application. In one of my views, I wish to display a list of current news ( IEnumerable<News> ) coming from a Web API. The thing is that the list of news may or may not be updated frequently. In other words, on an average day, the backend team may have to enter from 5 to 45 news using the backend CMS. I need to figure out a way to refresh the user’s list of news within his browser without, of course, refreshing the entire web page. My initial thought would have been

Hub.start - wait for finish

纵饮孤独 提交于 2019-12-11 06:39:39
问题 I'm using SignalR to transferring commands from client to server without refreshing the page. When the client enter some of my web pages, I'm starting a new hub connection. Like this: var hub = $.connection.siteControllerHub; $.connection.hub.start(); This "start()" function takes some time (+-5 seconds). mean while, the page is already finished loading and the user start using my UI. SingalR cannot serve the user, until it's finish loading the connection. I'm know that I'm can use the async

Can I debug OnConnected method in SignalR Hub?

拥有回忆 提交于 2019-12-11 04:19:17
问题 I have a Hub inside my asp.net project , and I overridden the OnConnected method, can I debug the code inside the OnConnected method? I put a breakpoint but it's not firing. public class ConsultasHub : Hub { public override Task OnConnected() { //breakpoint here //some code //[...] return base.OnConnected(); } } } 回答1: This is a tricky one. By design, if you don't have any subscriptions to the hub, then the client can't get any messages from server so the OnConnected won't get called. I tried

Intermittent problems with SignalR Hubs (in the Cloud) callback from Server to Client method

你离开我真会死。 提交于 2019-12-11 02:22:31
问题 So far, SignalR Hubs has been working perfectly with a locally hosted website in IIS 7.5 on my dev machine. I have the client making a signalr call to the server on a click event, then the server does a 20 second thread delay before sending a response back to the callback method on the client. This works consistently across all browsers. However, when I deploy my application to the Windows Azure Cloud, SignalR begins to have these intermittent problems. Specifically, there seems to be a

Instantiate SignalR Hub Object With IHubContext

守給你的承諾、 提交于 2019-12-10 23:25:35
问题 It seems like a big use for SignalR Hubs is to display the actions of one client to all of the other clients. What I hope to use SignalR for is when a certain event happens in my server side code, I want to instantiate a hub object and invoke one of its methods to communicate with all of the clients. If you see my previous post (Route To Take With SqlDependency OnChange), I would like to do this in the OnChange method of SqlDependency. Upon researching it I have found some people talk about

Signalr Hubs Not found (403)

纵饮孤独 提交于 2019-12-10 23:18:28
问题 Right, so I've seen loads of questions about this, but none of the suggested fixes have worked for me. I have a MVC4 project running in Visual Studio 2012/IIS Express, using SignalR to do some feedback to users. When I run the project I get a 403 error in Chrome like such: Failed to load resource: the server responded with a status of 403 (Forbidden) http://{website}/Hubs/ Uncaught Error: SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/hubs'><

Authenticate a .NET Core 2.1 SignalR console client to a web app that uses “Identity as UI”

那年仲夏 提交于 2019-12-10 18:18:41
问题 Using .NET Core 2.1 & VS2017 preview 2 I created a simple web server with "Identity as UI" as explained here and then added a SignalR chat following this. In particular I have: app.UseAuthentication(); app.UseSignalR((options) => { options.MapHub<MyHub>("/hubs/myhub"); }); .. [Authorize] public class MyHub : Hub .. "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:5000", "sslPort": 0 I start the debugger which

Call SignalR Hub from Backend Business Layer

人盡茶涼 提交于 2019-12-10 16:36:27
问题 I have an MVC website sitting onto of some fairly hefty business objects. My MVC Controllers call Manager objects which conducts and delegates work off to other sets of objects. Basically the code is deep server side, while a Hub in a way is just like a Controller in that it is fairly close to the client side. Is there a way to execute SignalR methods based on a reference to the Hub passed to these Manager objects? 回答1: If your MVC and SignalR services are running on the same process, you can