SignalR - 离开所有群组 [英] SignalR - Leave All Groups

查看:883
本文介绍了SignalR - 离开所有群组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用SignalR中心的客户可以添加或从组中删除。一个客户端可以属于多个组。是否有可能从各个它目前属于组删除客户端?我想我要的是像客户端[* allgroups *]。离开(Context.ConnectionId)

Using a SignalR hub clients can be added or removed from a group. A client can belong to multiple groups. Is it possible to remove a client from every group it currently belongs to? I guess what I'm looking for is something like Clients[*allgroups*].leave(Context.ConnectionId)

推荐答案

由于v0.5.2的,没有办法离开所有的组,因为服务器不跟踪客户端所属的组。你需要自己做,并且从每个组中的一个接一个的删除客户端。

As of v0.5.2, there is no way to leave all groups because the server doesn't keep track of the groups a client belongs to. You need to do this yourself and remove the client from each group one-by-one.

有对中却积压类似的要求,所以也许这将在未来的版本中实现:的 https://github.com/SignalR/SignalR/issues/66

There's a request for something similar in the backlog however, so maybe this will be implemented in a future release: https://github.com/SignalR/SignalR/issues/66

这篇关于SignalR - 离开所有群组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆