Exemplo n.º 1
0
 public override Task OnConnectedAsync()
 {
     if (Context.User.Identity.IsAuthenticated)
     {
         var user = DataService.GetUserByName(Context.User.Identity.Name);
         OrganizationConnectionList.TryAdd(Context.ConnectionId, user);
     }
     return(base.OnConnectedAsync());
 }
Exemplo n.º 2
0
 public override async Task OnConnectedAsync()
 {
     if (Context.User.Identity.IsAuthenticated)
     {
         var user = DataService.GetUserByName(Context.User.Identity.Name);
         OrganizationConnectionList.AddOrUpdate(Context.ConnectionId, user, (id, r) => user);
     }
     await base.OnConnectedAsync();
 }
Exemplo n.º 3
0
 public override async Task OnDisconnectedAsync(Exception exception)
 {
     if (Context.User.Identity.IsAuthenticated)
     {
         while (!OrganizationConnectionList.TryRemove(Context.ConnectionId, out var user))
         {
             await Task.Delay(1000);
         }
     }
 }
Exemplo n.º 4
0
        public override async Task OnDisconnectedAsync(Exception exception)
        {
            if (Context.User.Identity.IsAuthenticated)
            {
                OrganizationConnectionList.Remove(Context.ConnectionId, out _);
            }
            await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("ViewerDisconnected", Context.ConnectionId);

            if (AppConfig.RecordRemoteControlSessions)
            {
                RCSessionRecorder.StopProcessing(Context.ConnectionId);
            }
        }
Exemplo n.º 5
0
        public override async Task OnDisconnectedAsync(Exception exception)
        {
            if (Context.User.Identity.IsAuthenticated)
            {
                while (!OrganizationConnectionList.TryRemove(Context.ConnectionId, out var user))
                {
                    await Task.Delay(1000);
                }
            }
            await RCDeviceHub.Clients.Client(ScreenCasterID).SendAsync("ViewerDisconnected", Context.ConnectionId);

            if (AppConfig.RecordRemoteControlSessions)
            {
                RCSessionRecorder.EncodeFrames(Context.ConnectionId);
            }
        }