如何发送对组列表的响应并在SignalR Core中排除某些连接ID?
在aspnet.signalr.core中,在ihubConnectionContext
中,您可以将响应发送到一个组列表,同时排除某些连接IDS,即:
T Groups(IList<string> groupNames, params string[] excludeConnectionIds);
现在,
Clients.Groups(groupNames, exconnectionIds).ReceiveCollaborationNotification(response);
我已经迁移到<<<代码> aspnetcore.signalr.core ,没有这样的方法同时接受要排除的组名称和连接ID的列表。它确实具有下面提到的方法,但是该方法仅接受一个组名称,而不是列表。
T GroupExcept(string groupName, IReadOnlyList<string> excludedConnectionIds);
我如何实现t组(iList&lt; string&gt; groupNames,params string [] excludeConnectionIds
在aspnetcore.signalr.core.core.core
中使用
In AspNet.SignalR.Core, there was this method in IHubConnectionContext
where you can send a response to a list of groups while excluding some Connection Ids i.e:
T Groups(IList<string> groupNames, params string[] excludeConnectionIds);
This would be called as:
Clients.Groups(groupNames, exconnectionIds).ReceiveCollaborationNotification(response);
Now I have migrated to AspNetCore.SignalR.Core
and there is no such method that accepts both a list of group names and Connection Ids to be excluded. It does have the method mentioned below but this one only accepts one group name, not a list.
T GroupExcept(string groupName, IReadOnlyList<string> excludedConnectionIds);
How can I achieve what T Groups(IList<string> groupNames, params string[] excludeConnectionIds
does in AspNetCore.SignalR.Core
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在Signalr Core中,您具有此扩展方法:
您可以阅读有关它的更多信息在这里。
因此,为了实现自己想要的东西,您需要使用这些扩展方法。
In SignalR Core, you have this extension method:
You can read more about it here.
So to achieve what you want, you will need to use these extension methods.