Пример #1
0
        public ActionResult Disconnect(string sessionId, string userId)
        {
            var hubContext = GlobalHost.ConnectionManager.GetHubContext <SessionHub>();

            hubContext.Clients.Client(sessionId).disconnect(sessionId);

            if (MvcApplication.Sessions.Any(x => x.Value == userId))
            {
                var session = MvcApplication.Sessions.First(x => x.Value == userId);
                MvcApplication.AddSessionToDeleted(session.Key);
            }
            return(RedirectToAction("Index"));
        }