Closed muratoner closed 5 years ago
You have to write the logic to keep track of this yourself. SignalR has no API to provide # of connected users in a group.
Yes, you are right but signalr has "onconnected" and "ondisconnected" metod i'm write simple code and solve my problem in signalr. For example 'im increasing "connectedUserCount" variable when triggered "onconnected" signalr metod and i'm decreasing "connectedUserCount" variable when triggered "ondisconnected" signalr metod.
Counting the connections only works with 1 server, not when SignalR is scaled out. There is no way to get connection info across multiple servers (https://github.com/aspnet/SignalR/issues/1418). Also, the assumption that 1 user equals 1 connection is not valid.
A reliable solution would be to create an AddUser command in your MulticastVM instance for the clients to invoke, and manage your own user list separately, e.g. with a Redis cache. Detection of disconnection can be done by overriding the Dispose method (see discussion in issue #151).
i'm understood, thanks for help.
I'm using dotnetify in .net core and react-native projects but i have a problem and my problem this;
I want take connected user count in dotnetify but this proccess very basic in signalr. I don't know. How to solve this problem from dotnetify? Please help.