如何在服务器广播中仅向单个客户端而不是所有客户端使用 signalr?
How can I use signalr in server broadcast to a single client only, not all clients?
我想使用仅向单个客户端而不是所有客户端广播的信号服务器创建仪表板。
首先为每个用户创建组
(用户在浏览器中使用multitab并回调新的connectionid)
https://docs.microsoft.com/en-us/aspnet/core/signalr/groups?view=aspnetcore-5.0
和
public class MyEndPoint : PersistentConnection
{
protected override IList<string> OnRejoiningGroups(IRequest request, IList<string> groups, string connectionId)
{
return groups;
}
}
我想使用仅向单个客户端而不是所有客户端广播的信号服务器创建仪表板。
首先为每个用户创建组 (用户在浏览器中使用multitab并回调新的connectionid) https://docs.microsoft.com/en-us/aspnet/core/signalr/groups?view=aspnetcore-5.0 和
public class MyEndPoint : PersistentConnection
{
protected override IList<string> OnRejoiningGroups(IRequest request, IList<string> groups, string connectionId)
{
return groups;
}
}