SignalR – Checking if a user is still connected
Probably the most used solution is to keep a static variable containing users currently connected and overriding OnConnect and OnDisconnect or implementing IDisconnect depending on the version that you use. You would implement something like this: public class MyHub : Hub { private static List<string> users = new List<string>(); public override Task OnConnected() { users.Add(Context.ConnectionId); … Read more