Signalr check if hub already started

There are a few ways to approach this problem. The first is to create your own connection status tracking variables, which you set with the connection callback events: $.connection.hub.start().done(function() { ConnectionStarted = true; }) You can check ConnectionStarted before attempting to start the connection. Unfortunately, this won’t work well, as start() is asynchronous and so … Read more

Using Simple Injector with SignalR

Well, I tried yesterday and I’ve found a solution. According to me, the only moment where I want dependency injection in SignalR is for my hubs: I don’t care about how SignalR is working inside ! So instead of replacing the DependencyResolver, I created my own implementation of IHubActivator : public class SimpleInjectorHubActivator : IHubActivator … Read more

Proper Hub dependency lifetime management for SignalR and Castle Windsor

I’ve had a bit similar problem but with Unity instead of Castle Windsor. My requirements: I wanted to avoid singleton registrations on the container. All objects are resolved in Hub and should be disposed on Hub destruction. Registrations reused across Web Api and SignalR. Object lifetime is managed by HierarchicalLifetimeManager – child containers resolve and … Read more

SignalR: Is it necessary to remove the connection id from group OnDisconnect()?

According to the statement here, you don’t need to remove connections from groups: You should not manually remove the user from the group when the user disconnects. This action is automatically performed by the SignalR framework. When a connection subscribes to a topic (which happens when you add the connection to a group), it receives … Read more

How to use signalr in Android

UPDATE 2018: If you are using SignalR.net Core use this library otherwise you will get error on connection. SERVER SIDE: The following is my sample server-side code, you can pay attention to public void Send(string message) and public void SendChatMessage(string to, string message). Server-side app: public void SendChatMessage(string to, string message) Android client app: mHubProxy.invoke(“SendChatMessage”, … Read more

SignalR: detect connection state on client

This answer is specific to “SignalR version 2” the latest version “ASP.NET Core SignalR” may differ. SignalR version 2: The JS client attempts to reconnect for a certain time period, which defaults to 110 seconds. You can subscribe to the connection.stateChanged event, and get updates on when the state changes so that you can display … Read more

SignalR /signalr/hubs 404 Not Found

The order of route registration matters. I had this exact problem and fixed it by ensuring my global.asax.cs looked like this: public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteTable.Routes.MapHubs(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); } } This was in a web site using SignalR, MVC and WebApi all together.

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