Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manually create a group using SignalR

I have a list of userDetails connected to a hub and I am storing those users to List<UserDetails>.I want to add some of the users to a Group and broadcast a message to that group. But I am not able to figure out how can I create a group.This is what I a have done so far:

foreach(var user in userDetails)
{
      Groups.Add(user.connectionId, "Connected");
}
Clients.Group("Connected").broadcastMessage(message);
like image 875
Vivek Avatar asked Apr 25 '15 22:04

Vivek


1 Answers

when ever you add a user to a group, if that group doesn't exist already it will be created for you, you don't need to create it specifically.

like image 126
hmd.ai Avatar answered Sep 28 '22 15:09

hmd.ai