3 Answer(s)
-
0
From the documentation on SignalR AspNetCore Integration - Online Clients:
ASP<span></span>.NET Boilerplate provides the
IOnlineClientManager
to get information about online users (injectIOnlineClientManager
and useGetByUserIdOrNull
,GetAllClients
,IsOnline
methods for example).Related
- Current number of active user CONNECTIONs: aspnetzero/aspnet-zero-core#1414
- Current number of active USERs: aspnetzero/aspnet-zero-core#1415
-
0
I injected IOnlineClientManager but didn't see GetByUserIdorNull rather it's GetAllByUserId. And there is no clear documentation on how to get the number of active users. Any help is appreciated.
-
0
I injected IOnlineClientManager but didn't see GetByUserIdorNull rather it's GetAllByUserId.
That's correct, since a user can have more than one client connection. That line in the documentation is outdated.
And there is no clear documentation on how to get the number of active users.
GetAllClients
, group byclient.UserId
and then count.