Ejemplo n.º 1
0
        public override async Task OnConnectedAsync()
        {
            RemotelyUser = DataService.GetUserByID(Context.UserIdentifier);
            if (await IsConnectionValid() == false)
            {
                return;
            }
            ConnectionIdToUserLookup.AddOrUpdate(Context.ConnectionId, RemotelyUser, (id, ru) => RemotelyUser);

            await Clients.Caller.SendAsync("UserOptions", RemotelyUser.UserOptions);

            await base.OnConnectedAsync();
        }
Ejemplo n.º 2
0
 public override async Task OnDisconnectedAsync(Exception exception)
 {
     ConnectionIdToUserLookup.Remove(Context.ConnectionId, out _);
     await base.OnDisconnectedAsync(exception);
 }