Beispiel #1
0
        public override async Task OnDisconnectedAsync(HubConnectionContext connection)
        {
            await _wrappedHubLifetimeManager.OnDisconnectedAsync(connection);

            _connections.Remove(connection);
            await _userTracker.RemoveUser(connection);
        }
        public override async Task OnDisconnectedAsync(HubConnectionContext connection)
        {
            await _wrappedHubLifetimeManager.OnDisconnectedAsync(connection);

            _logger.LogCritical($"OnDisconnectedAsync : {connection.ConnectionId }");
            _connections.Remove(connection);
            await _userTracker.RemoveUser(connection);
        }
Beispiel #3
0
        public override async Task OnDisconnectedAsync(Exception exception)
        {
            _notificator.RemoveConnection(Context.Connection);

            //await Clients.Client(Context.ConnectionId).InvokeAsync("OnDisconnected", "You've disconected");

            await base.OnDisconnectedAsync(exception);

            await _userTracker.RemoveUser(Context.Connection);
        }
Beispiel #4
0
        public override async Task OnDisconnectedAsync(Exception exception)
        {
            var currentUser = userTracker.GetUser(Context.ConnectionId);

            userTracker.RemoveUser(currentUser);

            await OnUsersLeft(currentUser);

            await base.OnDisconnectedAsync(exception);
        }
Beispiel #5
0
        public override Task OnDisconnectedAsync(Exception exception)
        {
            var name      = Context.User?.Identity?.Name;
            var sessionId = Context.User?.FindFirstValue("sid");

            _userService.RemoveUser(sessionId);
            Clients.Others.SendAsync("UserLoggedOut", new User {
                Name = name, Id = sessionId
            });
            return(base.OnDisconnectedAsync(exception));
        }
        public override async Task OnDisconnectedAsync(HubConnectionContext connection)
        {
            await _wrappedHubLifetimeManager.OnDisconnectedAsync(connection);

            _connections.Remove(connection);

            var users = await _userTracker.UsersOnline();

            var user = users.Where(t => t.ConnectionId == connection.ConnectionId).FirstOrDefault();

            await _userTracker.RemoveUser(connection, user.PushToken.Any(t => t.Device != "desktop"));
        }
 public override Task OnDisconnectedAsync(Exception exception)
 {
     _userTracker.RemoveUser(Context.ConnectionId);
     return(base.OnDisconnectedAsync(exception));
 }
Beispiel #8
0
 public override async Task OnDisconnectedAsync(System.Exception exception)
 {
     await base.OnDisconnectedAsync(exception);
     _userTracker.RemoveUser(Context.Connection);
     await Clients.All.Counter(_userTracker.UsersOnline().Count());
 }