Questions tagged [signalr]

ASP.NET SignalR is a library for ASP.NET developers that makes it simple to add real-time functionality to your web applications. That is, to have your server-side code push content to the connected clients as it happens, in real-time.

SignalR is an asynchronous library for .NET to help build real-time, multi-user interactive web applications.

SignalR lets you communicate with clients on your website in real time through the best continuous connections available between browser and server (WebSocket between Chrome and IIS 8, but long polling between Internet Explorer 9 and IIS 7.5).

SignalR allows you to call methods from the server on the client (.NET , JavaScript, Java) and reciprocally. You can invoke methods on every client or a subset of clients.

Extensive documentation and guides are found here.

SignalR can be downloaded through NuGet here.

The source code is available on GitHub.

The JavaScript client package (jQuery plugin)

9391 questions
35
votes
6 answers

Using Simple Injector with SignalR

I thought using my own IoC would be pretty straight forward with SignalR and maybe it is; most likely I'm doing something wrong. Here's my code I have so far: private static void InitializeContainer(Container container) { …
rball
  • 6,925
  • 7
  • 49
  • 77
34
votes
3 answers

Is it possible to call a SignalR Hub from Postman

I have an ASP .Net Core 2.2 Web API with a SignalR hub. Is it possible to call one of its methods (for example, SendMessageToAll) using Postman? The problem is that I only have the API - no frontend - and I need to test. I tried putting the URl to…
34
votes
1 answer

Where are these poll requests from SignalR coming from?

I have a SPA application using Durandal. My program starts to have a http request…
mehrandvd
  • 8,806
  • 12
  • 64
  • 111
34
votes
3 answers

Signalr check if hub already started

I have multiple javascript blocks with signalR functions. I don't know the order of execution so that i want to start the hub with $.connection.hub.start(); if it isn't started already. How can i check if the hub is already started? Starting it…
daniel
  • 34,281
  • 39
  • 104
  • 158
34
votes
6 answers

Render MVC PartialView into SignalR response

I would like to render a PartialView to an HTML string so I can return it to a SignalR ajax request. Something like: SignalR Hub (mySignalHub.cs) public class mySignalRHub: Hub { public string getTableHTML() { return…
James
  • 7,877
  • 7
  • 42
  • 57
33
votes
4 answers

Is it correct to use SignalR for desktop applications?

Is SignalR suitable for windows desktop applications (winforms/wpf)? What are the advantages and disadvantages using SignalR with windows desktop applications? Are there any performance considerations? I want to make real-time connections between…
Seçkin Durgay
  • 2,758
  • 4
  • 27
  • 36
33
votes
5 answers

SignalR : use camel case

I would like to know if there is a way to configure SignalR so that the client functions in the hub return objects using camel case. Thanks.
dafriskymonkey
  • 2,189
  • 6
  • 25
  • 48
33
votes
3 answers

How to do guaranteed message delivery with SignalR?

I am developing real-time client-server application using C# and SignalR. I need to send messages to client as fast as possible. My code on server: for (int i = 0; i < totalRecords; i++) { …
Dmitry Kazakov
  • 1,639
  • 3
  • 27
  • 47
33
votes
7 answers

how to get SignalR user connection id out side the hub class?

I am using SignalR in my ASP.NET web application. Here I am calling client from outside to hub class using IHubContext. I need to get the current user's connection ID in order to send messages to the current user only. How can I get the connection…
selvakumar
  • 1,771
  • 3
  • 20
  • 34
33
votes
1 answer

signalR - getting username

I am using signalr and asp.net MVC3 to build a sample chat application. Here is what my signalr hub looks like public class MyHub:Hub,IDisconnect { public Task Join() { string username = HttpContext.Current.User.Identity.Name; //find group…
user1625066
33
votes
3 answers

Multiple signalR connections/hubs on your website

If I have multiple pages that could use multiple hub classes, what is the best way to manage this? For instance: Is it bad to navigate to another page in the website and essentially "reopen" the connection to the same hub class that was open on the…
anthonypliu
  • 12,179
  • 28
  • 92
  • 154
33
votes
5 answers

SignalR $.connection is undefined

I admit it, I don't know what I'm doing. I'm attempting to learn how to use SignalR and I'm following various samples online almost verbatim and I can't get pasted $.connection being undefined. I'm working in MVC 4.0 and trying to use either…
Danny Ellis Jr.
  • 1,674
  • 2
  • 23
  • 38
32
votes
3 answers

SignalR in ASP.NET Core behind Nginx

I have a server with ubuntu 16.04, kestrel and nginx as a proxy server that redirects to localhost where my app is. And my app is on Asp.Net Core 2. I'm trying to add push notifications and using SignalR core. On localhost everything is working…
Artyom
  • 654
  • 2
  • 7
  • 16
32
votes
5 answers

"Don't use StringBuilder or foreach in this hot code path"

I am browsing the source code of the Open Source SignalR project, and I see this diff code which is entitled "Don't use StringBuilder or foreach in this hot code path" : - public static string MakeCursor(IEnumerable cursors) + …
Larry
  • 17,605
  • 9
  • 77
  • 106
32
votes
2 answers

Java client to connect to SignalR?

I'd like to connect to a SignalR-server from a java client. Is that possible? Has anybody written a java-client to connect to SignalR?
Erik Z
  • 4,660
  • 6
  • 47
  • 74