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()); }
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(); }
public override async Task OnDisconnectedAsync(Exception exception) { if (Context.User.Identity.IsAuthenticated) { while (!OrganizationConnectionList.TryRemove(Context.ConnectionId, out var user)) { await Task.Delay(1000); } } }
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); } }
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); } }