
To add or remove users from a group, you call the Add or Remove methods, and pass in the user's connection id and group's name as parameters.


SignalR sends messages to clients and groups based on a pub/sub model, and the server does not maintain lists of groups or group memberships. There is no API for getting a group membership list or a list of groups. For an introduction to using groups, see How to manage group membership from the Hub class in the Hubs API - Server Guide. In effect, a group is automatically created the first time you specify its name in a call to Groups.Add, and it is deleted when you remove the last connection from membership in it. You don't have to explicitly create groups. A group can have any number of clients, and a client can be a member of any number of groups. Groups in SignalR provide a method for broadcasting messages to specified subsets of connected clients. If you have questions that are not directly related to the tutorial, you can post them to the ASP.NET SignalR forum or. Please leave feedback on how you liked this tutorial and what we could improve in the comments at the bottom of the page.

Software versions used in this topicįor information about earlier versions of SignalR, see SignalR Older Versions.

This topic describes how to add users to groups and persist group membership information. This documentation isn't for the latest version of SignalR.
