I have a hub with method that is called client-side. This method launches a timer with a delegate that runs every 10 seconds. Since it wouldn’t make sense to keep running this delegate if no one is connected to the hub, I want to check if any users are still connected from inside the delegate before I reschedule it. Is there any way to do this?
Share
Probably the most used solution is to keep a static variable containing users currently connected and overriding
OnConnectandOnDisconnector implementingIDisconnectdepending on the version that you use.You would implement something like this: