I'm just start testing SignalR for monitoring application . I have a control which make a call to the Hub by the client side. I noticed , each time the client make Connection.Hub.Start() it creates a new Hub instance in the server , I need to refresh my control all the time , so I don't want it to create new Hub for each one.
Is there a way to create single Hub for all clients or I'm missing something?
A Hub instance is created for each request, much like an ASP.NET Page instance is created for each request in WebForms, a Controller is created for each request in ASP.NET MVC or a WCF service instance is created for each service request when using InstanceMode.PerCall.
If you want to maintain shared state between Hub requests/instances you would need to use a static field or some other, more advanced form of state sharing (e.g. dependency injected singleton).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With