public bool DisassociateUser(Guid userID) { if (!UserSessions.TryRemove(userID, out Guid found)) { return(false);// No session associated } AdminSessions.TryRemove(userID, out _); SessionSockets.TryRemove(found, out _);//remove stale socket - TODO check Console.WriteLine(string.Format("Dissacociated user {0}", userID)); return(true); }
public void HandleWebSocketClosing(HttpContext context) { SessionSockets.TryRemove(Guid.Parse(context.Session.Id), out _); Console.WriteLine(String.Format("closed wss for session {0}", Guid.Parse(context.Session.Id))); }