简体   繁体   中英

How can I use signalr in server broadcast to a single client only, not all clients?

I want to create a dashboard using signalr server broadcasting to a single client only, not all clients.

first you create group for each user (user use multitab in browser and call back new connectionid) https://docs.microsoft.com/en-us/aspnet/core/signalr/groups?view=aspnetcore-5.0 and

    public class MyEndPoint : PersistentConnection 
{
    protected override IList<string> OnRejoiningGroups(IRequest request, IList<string> groups, string connectionId)
    {
        return groups;
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM