//I'm not sure this is going to work in the same browser with two tabs in deploy, need to test it. public override Task OnDisconnected(bool stopCalled) { var clients = new ClientsRepoHelper(RepositoryIsolator.Of.Clients); clients.Delete(Context.ConnectionId); System.Diagnostics.Debug.WriteLine(clients.Count()); return(base.OnDisconnected(stopCalled)); }
public override Task OnConnected() { var ip = Context.Request.HttpContext.Connection.RemoteIpAddress.ToString(); var clients = new ClientsRepoHelper(RepositoryIsolator.Of.Clients); clients.Add(ip, new Client(Context.ConnectionId, Context.User.Identity.Name)); System.Diagnostics.Debug.WriteLine(clients.Count()); return(base.OnConnected()); }