简体   繁体   English

如何在服务器广播中使用 signalr 仅对单个客户端,而不是所有客户端?

[英]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.我想使用 signalr 服务器创建一个仪表板,仅广播到单个客户端,而不是所有客户端。

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首先为每个用户创建组(用户在浏览器中使用 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;
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果signalR服务器(WPF)意外停止,如何注销所有客户端? - How can I Log out all the clients if signalR server(WPF) stopped accidentally? SignalR横向扩展客户端到服务器广播 - SignalR scaleout client to server broadcast 如何通过使用WCF NetHttpBinding(WebSockets)的服务器将一个客户端发送的消息广播(推送)到所有客户端? - How to broadcast (push) a message send by one client, to all clients through a server using WCF NetHttpBinding (WebSockets)? 如何向单个客户端发送 SignalR 消息? - How can I send SignalR message to a single client? 如何通过Web API向所有客户端广播消息 - How do i broadcast a message to all clients via Web API 从服务器向所有客户端发送信号器消息 - Send signalr message from server to all clients SignalR:服务器如何建立与客户端的连接? - SignalR: how Server can establish connection to Client? 使用Signalr通知除自身以外的所有客户 - Use signalr to notify all clients except self 是否可以仅将信号器用于从服务器到客户端的数据接收? - Is it possible to use the signalr only for receiving data from server to Client? 如何修复 SignalR System.InvalidOperationException InvokeAsync 仅适用于单一客户端 - How to fix SignalR System.InvalidOperationException InvokeAsync only works with Single Clients
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM