创建现场插座基于数据的网页 [英] Create web page with live socket based data
问题描述
我需要的接口一个网站,通过套接字现有的系统。
基本上,我需要连接到插座,保持开放,并得到所有自带通过对网站的数据。
I need to interface a website with an existing system via sockets. Basically I need to connect to the socket, keep it open, and get all the data that comes through to the website.
我试图找到一种可伸缩的方式来实现这一目标。
我首先想到的是,我可以用彗星或Socket.IO从Web服务器到Web客户端获取数据。但是,服务器是ASP.Net,我不相信,我可以打开在ASP.Net每个用户长期居住套接字连接。
I am trying to find a scalable way to accomplish this goal. My first thought was that I can use Comet or Socket.IO to get the data from the web server to the web client. But the server is ASP.Net and I do not believe that I can open a long lived socket connection for each user in ASP.Net.
理想我想客户端浏览器来打开和维护自己的socket连接到数据源。我无法找到一个方法来做到这一点。这甚至可能?
Ideally I would want the clients browsers to open and maintain their own socket connection to the data source. I cannot find a way to do this. Is this even possible?
因为我被困在这个问题pretty我可以使用您有任何的意见。
I could use any advice you have as I am pretty stuck on this problem.
谢谢!
推荐答案
正如保罗在评论SignalR建议是一个很好的解决方案。下面是ASP.NET兼容的解决方案的完整列表:
As Paul suggested in the comment SignalR is a good solution. Here's a full list of ASP.NET compatible solutions:
- Pokein
- WebSync by FrozenMountain
- SignalR
有其他自托管实时Web技术一>,但你需要以某种方式您的ASP.NET应用程序和实时Web服务器之间的接口(队列或网络挂接)。
There are other self hosted realtime web technologies but you'd need to interface between your ASP.NET app and the realtime web server in some way (Queues or WebHooks).
另外一种选择是使用像推,谁对我工作的托管服务。托管服务需要保持持续的连接和扩展解决方案的实时通讯方面的压力。
The other option is to use a hosted service like Pusher, who I work for. A hosted service takes the strain of maintaining the persistent connections and scaling the realtime messaging aspect of your solution.
这篇关于创建现场插座基于数据的网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!