signalr

SignalR v2.3.0 in Android

落爺英雄遲暮 提交于 2019-12-10 18:49:37
问题 I have a MVC .NET application that uses signalR. I tried to download this client: https://github.com/Gurgen/SignalR-.net-core-android-client I ran it on my device. Pressed the connect button. But kept getting an exception. Debugging it I found that I had to change this line String connectionId = jsonElement.getAsJsonObject().get("connectionId").getAsString(); to this String connectionId = jsonElement.getAsJsonObject().get("ConnectionId").getAsString(); I am already starting to feel like this

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

Turn by Turn game: Use SignalR or both SignalR and REST API?

痞子三分冷 提交于 2019-12-10 17:27:49
问题 I'm write a turn-by-turn mobile game. Each game have 2 minutes. So every two minutes server will calculate rank and generate next game to clients. I use Asp.net to write server. I choose SignalR to communicate between client and server. I have 2 choices for implementing games: 1) Use SignalR only to communicate with clients 2) Use SignalR to notify client, and use REST API to get or update information of game. Could you please advice me what choice is better and please explain detail. Thanks

How to use signalr v2 beta in asp.net mvc 4

谁说胖子不能爱 提交于 2019-12-10 17:24:43
问题 Before v2: RouteTable.Routes.MapHubs(); In v2, MapHubs does not exist anymore. The wiki says to add a Startup class and a Configuration method and a call to app.MapHubs(). namespace MyAssembly { public class Startup { public void Configuration(IAppBuilder app) { //Before v2 //RouteTable.Routes.MapHubs(); app.MapHubs(); } } } But the method is never called, no error occurs, and ... no hub are setup. I suppose there is some code to add to global.asax.cs What is the secret ? 回答1: Try defining

Using SignalR Hubs, connection is lost after some time - why?

家住魔仙堡 提交于 2019-12-10 17:16:25
问题 In my SignalR app, callbacks are fired as expected on a page. If the page is left for some time, callbacks are no longer invoked on that page until it is refreshed. I suspect that this could be due to the site's session expiring (using a client's session ID to invoke a client notification). I read here about the KeepAlive functionality and can see some references to it in the SignalR code. I am unclear if a client-side keep-alive needs to be implemented, and if so, how? 回答1: I haven't made

SignalR Client - The remote server returned an error (401 Unauthorized)

醉酒当歌 提交于 2019-12-10 16:48:23
问题 Premise I'm attempting to make a windows service act as a signalR client to a web server (MVC3 project running on IIS Express). When trying to connect to the server, a 401 Unauthorized is returned. Now, as far as I understand, the windows service runs under the account NETWORK_SERVICE, and it makes sense that this is not a valid user name to connect to the IIS. However, I've tried configuring SignalR in the following way: Init private static Connection WebUIConnection = new Connection("http:/

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

how to setup a C# winforms application to host SignalR Hubs?

邮差的信 提交于 2019-12-10 16:28:42
问题 I have read through the SignalR docs and watched a few of the videos, however I can not get SignalR to host within a winforms application. I have tried using source code off the SignalR wiki: https://github.com/SignalR/SignalR/wiki/Self-host If you look at the "Full Sample - Hubs", what is the "server" variable? I do not understand how this works or how to convert it to C#. According to the wiki "The default SelfHost implementation is built on HttpListener and can be hosted in any kind of

SignalR with Redis Backplane Behind F5 - StatusCode: 400, ReasonPhrase: 'Bad Request'

懵懂的女人 提交于 2019-12-10 16:17:19
问题 I'm using SignalR version 2.1.2 with SignalR.Redis 2.1.2 on Server 2012 R2, IIS 8.5 with WebSockets enabled. All is running perfectly in my development environment. I can even stand up copies on different servers (e.g. http machine1/myapp/signalr, http machine2/myapp/signalr) of the site configured to use the same backplane, and both UI's get messages pubb'd to them perfectly. I then moved "myapp" to our next environment, which is a cluster of 2 machines sitting behind an F5 load balancer,

How do I configure routing for MVC and SignalR in an ASP.NET Core project?

不想你离开。 提交于 2019-12-10 16:00:05
问题 I'm trying to build a web app with ASP.NET Core 2.1.0-preview1 and ASP.NET Core SignalR 1.0.0-alpha1 with an Angular4 client. So far I've been able to muddle through and can actually open a SignalR web socket connection from within the client. That came at a price, though, here's an excerpt of my Startup.cs : app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); /*routes.MapSpaFallbackRoute( name: "spa-fallback", defaults: new {