signalr

Asp.net session never expires when using SignalR and transport mode long polling

六月ゝ 毕业季﹏ 提交于 2019-12-21 06:58:01
问题 We have a web application that uses SignalR for its notification mechanism.The problem is when we are browsing our web application using IE ,SignalR uses Long Polling as its transport type thus sends back requests to our web server therefore Session never expires no matter how long the browser is idle. We were thinking that maybe we could catch the requests in Global.asax and see if they were from SingalR and set the session timeout to the remaining time (Which I don't think it's a

SignalR authentication within a Controller?

懵懂的女人 提交于 2019-12-21 05:47:13
问题 I'm playing with SignalR, and I can't seem to grasp authentication to build a demo app for public vs secure chat. There is one chat room, and I want to demonstrate that authenticated users will receive public messages and authenticated user messages. Authentication is done using the stock MVC(3) Internet app in AccountController . Getting a Hub context within the controller doesn't make sense, since it doesn't have the connection id. How can I get the connection id to add the specific

How can I pass a SignalR hub context to a Hangfire job on ASP .NET Core 2.1?

ぐ巨炮叔叔 提交于 2019-12-21 05:22:32
问题 How can I pass a SignalR hub context to a Hangfire job on ASP .NET Core 2.1? It seems that since passing arguments to Hangfire is done via serialization/deserialization, it seems that Hangfire has hard-time reconstructing the SignalR hub context. I schedule the job (in my controller) using : BackgroundJob.Schedule(() => _hubContext.Clients.All.SendAsync( "MyMessage", "MyMessageContent", System.Threading.CancellationToken.None), TimeSpan.FromMinutes(2)); Then after 2 minutes, when the job

Can self hosted SignalR on the Raspberry Pi work?

风流意气都作罢 提交于 2019-12-21 05:02:34
问题 I want to have a C#/mono/signalR based web page hosted on the Raspberry Pi - is this possible? I have managed to write a client-server-client solution where the signalR hub is hosted on a PC running IIS 8. A console app on the pi connects to the server hub with the c# signalR client. The asp.net server also hosts a 'remote control' page for a browser client to send commands to the pi but now I want to eliminate the PC as a requirement and have everything hosted on the pi. 回答1: TLDR It can be

SignalR Owin Self-Host on Linux/Mono SocketException when clients lose connection

前提是你 提交于 2019-12-21 04:45:07
问题 I'm running very simple signalr server self-hosted via Owin on ubuntu server 14.04, mono 3.2.8. (code below). Connecting/Disconnecting works fine on both a remote windows server and when I deploy the bits to the linux server. But when a client dies unexpectedly instead of telling signalr that he's disconnecting, that's when I get a never-ending SocketException only on the linux server only. The windows server disconnects the client after about 30 seconds or so, but the linux server spews the

Communication between a WebJob and SignalR Hub

。_饼干妹妹 提交于 2019-12-21 04:06:15
问题 I have the following scenario: I have an azure webjob (used to send mails) and I need to check the progress of the webjob in my web application. I am using SignalR to communicate with clients from my server. When I want to send an email, I push a message in the queue and the azure webjob does his job. The question is, how can I communicate the progress of the webjob to the client? Originally my idea was to push a message from the webjob, so the Hub could read it from the queue. Then, I would

Using an existing IoC Container in SignalR 2.0

眉间皱痕 提交于 2019-12-21 02:22:12
问题 How can I use an existing IoC with SignalR 2.0? From the tutorial, it seems I need to setup a class to be called from OWIN via an attribute: using Microsoft.Owin; using Owin; [assembly: OwinStartup(typeof(SignalRChat.Startup))] namespace SignalRChat { public class Startup { public void Configuration(IAppBuilder app /*HOW AM I GONNA GET UNITY CONTAINER HERE?*/) { var hubConfig = new HubConfiguration() { EnableJSONP = true, EnableDetailedErrors = true, EnableJavaScriptProxies = true, Resolver =

SignalR .Net Client - Unexpected character encountered while parsing value

笑着哭i 提交于 2019-12-21 01:21:32
问题 I'm trying to set up a .Net client to send messages to my signalR hub from my service layer. I'm following this guide: http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-net-client#callserver This is what I have: _hubConnection = new HubConnection(_baseUrl); // "http://localhost:3806" _hubProxy = _hubConnection.CreateHubProxy("AppHub"); _hubConnection.Start().Wait(); The hub lives inside of the same project - it's an MVC application with forms authentication. I can never

SignalR .Net Client - Unexpected character encountered while parsing value

☆樱花仙子☆ 提交于 2019-12-21 01:21:22
问题 I'm trying to set up a .Net client to send messages to my signalR hub from my service layer. I'm following this guide: http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-net-client#callserver This is what I have: _hubConnection = new HubConnection(_baseUrl); // "http://localhost:3806" _hubProxy = _hubConnection.CreateHubProxy("AppHub"); _hubConnection.Start().Wait(); The hub lives inside of the same project - it's an MVC application with forms authentication. I can never

Signalr persistent connection with query params.

房东的猫 提交于 2019-12-20 19:40:00
问题 I have a persistent connection which I would like to start with some seed info using query params. Here is the override in the connection. protected override Task OnConnected(IRequest request, string connectionId) { //GET QUERY PARAMS HERE return base.OnConnected(request, connectionId); } Now I have my route setup in global.asax file which looks like this. RouteTable.Routes.MapConnection("myconnection", "/myconnection"); And the client code looks like this var connection = $.connection('