Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
用户离开活动站点以将其状态从在线更改为离线并向客户发送消息表明他离开了该站点。
您可以绑定到断开连接的事件。
所以在你的集线器中添加方法:
public override Task OnDisconnected() { // The Context.ConnectionId is the identity of the disconnected client return Clients.All.userOffline(/* Something here to identify the user */); }