Context.User.Identity.Name is null with SignalR 2.X.X. How to fix it?

I found the final solution, this is the code of my OWIN startup class: public void Configuration(IAppBuilder app) { app.MapSignalR(); // Enable the application to use a cookie to store information for the signed i user app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString(“/Home/Index”) }); // Use a cookie to temporarily store information … Read more

Call a hub method from a controller’s action

The correct way is to actually create the hub context. How and where you do that is up to you, here are two approachs: Create a static method in your hub (doesn’t have to be in your hub, could actually be anywhere) and then you can just call it via AdminHub.SendMessage(“wooo”) public static void SendMessage(string … Read more

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

IConnectionManager does not exist any more in SignalR for ASP.Net Core. I’ve been using HubContext for getting access to a hub. public class HomeController : Controller { private readonly IHubContext<LiveHub> _hubContext; public HomeController(IHubContext<LiveHub> hubContext) { _hubContext = hubContext; } public void SendToAll(string message) { _hubContext.Clients.All.InvokeAsync(“Send”, message); } } I’m using .net core 2.0.0 and SignalR … Read more

When does a reconnect in signalR occur?

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 … Read more

While using signalr, will there be any connection limits on IIS

You should review the Performance Section of the SignalR Wiki on GitHub. This provides some really good guidance for the following: IIS Configuration – Max Concurrent Requests Per Application ASP.NET Configuration – Max Concurrent Requests & Request Queue Limits Additionally, it states the key Peformance Counters to monitor when performing load testing of your application. … Read more

Difference between ASP.NET WebHooks and Signal-R

SignalR is for notification within an ASP.NET app using WebSockets. You can exchange event notifications through WebSockets, however it requires a constant network connection. WebHooks are for event notification across other web applications and other external services. (Think B2B communication). For instance, you can receive a WebHook when someone sends you money to your PayPal … Read more

.NET 4.5 WebSockets vs SignalR

I think SignalR is the way to go, and is going to be part of .NET itself anyway (and likely extend/merge/replace web-sockets support). It uses web sockets when it’s supported, and consistent client polling hack when it’s not, so, it’s the way to go. Update: Since this answer is still getting upvoted, it’s worth mentioning … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)