从调用特定SignalR客户端 [英] Call specific client from SignalR
问题描述
我想从服务器调用特定的客户端,而不是广播到所有的人。问题是,我在一些AJAX请求的范围(在的.aspx codebehind让说),而不是在集线器或PersistentConnection,所以没有客户财产 - 和客户端谁做了AJAX(jQuery的)调用不是客户端我想给signalr消息!
I want to call specific client from server, and not broadcast to all of them. Problem is that I'm in scope of some AJAX request (in .aspx codebehind let say), and not in Hub or PersistentConnection, so don't have Clients property - and client who made that ajax (jquery) call is not the client I want to send signalr message!
现在,我有一个集线器,它的要求JS页面加载,用于注册新的客户端服务器进入静态列表,所以我有客户端的GUID。但不知道如何使用从服务器发送消息给特定的客户端。
Now, I have one hub that it's called on JS page load, which registers new client into server static list, so I have client Guids. But don't know how to use that to send message from server to specific client.
推荐答案
请参阅最新的文档:
持续连接 - https://github.com/SignalR/SignalR/wiki/PersistentConnection一>
集线器 - 的http:// www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-server
这篇关于从调用特定SignalR客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!