Is there a way to check if a group has any open connections?
See original GitHub issueI would like to be able to check if a group I am about to send a message to has any open connections and possibly how many. I see this information is available internally on the client hub in the lifetime manager > client connection manager
but i don’t see any of this exposed in any way. The reason I want to perform this check is to decide if I should send a SignalR message to the connected clients or send a push notifications (I’m dealing with iOS mobile clients). Currently I don’t see any way of doing something like that.
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (7 by maintainers)
Top Results From Across the Web
c# - How can I check how many connections are in a Group ...
I see the group coming back as Microsoft.AspNetCore.SignalR.Internal.GroupProxy<ChatHub> at runtime with no public methods. Internal private ...
Read more >Finding Servers in Connections and Groups
You can look up a specific server to see all the connections and groups it is part of. This is useful in several...
Read more >How do I find out which process is using up all the TCP ...
Open a command prompt window as administrator . From there type the following command: netstat -b -a. This will give you a list...
Read more >Working with Groups in SignalR
Verifying group membership when reconnecting By default, SignalR automatically re-assigns a user to the appropriate groups when reconnecting ...
Read more >How to See Active SQL Server Connections For Database
Here is the script which will give us answer to the question. SELECT DB_NAME(dbid) AS DBName, COUNT(dbid) AS NumberOfConnections, loginame
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We plan to add an existence check in the service REST API to check “if a group has any open connections”, according to the deployment schedule it would be available in late April, and ManagementAPI will be updated accordingly after the service is ready.
So if I understand correctly in a simple scenario when there is only one SignalR server. The internal lifetime manager already maintains a collection of connected clients. But the suggested way is to replicate that collection and maintain it for myself just because the API does not provide a readonly way of querying it.
I think it should be opened as a readonly collection because for debug purposes it is just way more convenient than writing a whole infrastructure in order to create something that is already there.