C
C#•4mo ago
Steel

SignalR Groups not working

Nothing special, just trying to use groups in SignalR and it's just not working. Am I doing something wrong, and if not, anyone see this issue before? .NET 8 Works
await _hubContext.Clients.All.SendAsync("Test");
await _hubContext.Clients.All.SendAsync("Test");
Doesn't work
await _hubContext.Groups.AddToGroupAsync(HttpContext.Connection.Id, "Pizza");
await _hubContext.Clients.Group("Pizza").SendAsync("Test");
await _hubContext.Groups.AddToGroupAsync(HttpContext.Connection.Id, "Pizza");
await _hubContext.Clients.Group("Pizza").SendAsync("Test");
9 Replies
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Salman
Salman•4mo ago
also Doesn't work won't tell us anything . explain how it doesn't work . Or if you're even listetning to the Pizza group or nah.
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Steel
SteelOP•4mo ago
What else do you need? I said Clients.All.Send works to show I have SignalR working in my project. I've followed the docs and I don't see anything extra I have to do for groups. Really just wondering if the code I sent is correct or not and if not has anyone had issues with implementing groups https://github.com/CodeSteel/MeChat/blob/main/Services/ChatHub.cs I'm pretty certain it's not. So maybe HttpContext.Connection.Id is wrong? or Im using it wrong? I know connectionId resets after refreshing the page. Maybe that's to do with it?
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Steel
SteelOP•4mo ago
Howcome?
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Steel
SteelOP•4mo ago
hmm so how do I get the signal's connection? then thats my issue lol ill figure it out, thanks man also, see that, I gave all the info needed 🙂
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server