简体   繁体   English

帮我解决.NET实时应用程序的问题

[英]Help me a solution for a .NET real-time application

I am developing a system which include a server app & a client app, note: the number of clients can be to million. 我正在开发一个包含服务器应用程序和客户端应用程序的系统,请注意:客户端数量可能达到数百万。 These are my requirements: 这些是我的要求:

  • Client must authenticate (username & password) to server to be accepted connection. 客户端必须对服务器进行身份验证(用户名和密码)才能接受连接。 And client will listen to server, and receive any data which sent from server. 客户端将监听服务器,并接收服务器发送的所有数据。
  • When server has data, server will send to all connected clients. 当服务器中有数据时,服务器将发送到所有连接的客户端。

Please help me some solution. 请帮我一些解决方案。 Note: client is a WinForm application, and server is any kind of application which it can send data to all connected clients. 注意:客户端是WinForm应用程序,服务器是任何类型的应用程序,它可以将数据发送到所有连接的客户端。

P/S: At the moment, my project use .NET Remoting but it is not suitable with my requirements because server can not send data to clients. P / S:目前,我的项目使用.NET Remoting,但由于服务器无法将数据发送到客户端,因此它不适合我的要求。 I make a trick: Each client will send request to server each 2 seconds once to check that server has new data or no. 我有个窍门:每个客户端每2秒就会向服务器发送一次请求,以检查服务器是否有新数据。 If yes, client will receive data. 如果是,则客户端将接收数据。 I need a new solution to replace. 我需要一个新的解决方案来替换。

Thanks. 谢谢。

Take a look at Duplex WCF Services 看看Duplex WCF服务

Word of warning, this does not work over https. 警告词,这不适用于https。

Alternatively the Windows Azure Service Bus also supports Duplex communication. 另外, Windows Azure Service Bus也支持双工通信。

Well you need to start by asking yourself and important question, is a 2 second poll interval really a requirement? 那么,您需要首先问自己和重要的问题,是否真的需要2秒的轮询间隔? Can you make it less frequent. 你能减少它的频率吗?

Do you in fact want to use frequent polling, or would you prefer to use another technique such as long polling (where a connection is held open until there is new data, then it is closed and recreated) or a true comet/PUSH setup where the connection is always open. 实际上,您是否要使用频繁的轮询,还是要使用另一种技术,例如长时间轮询(将连接保持打开状态直到有新数据,然后将其关闭并重新创建)或使用真正的彗星/ PUSH设置,例如连接始终处于打开状态。

Another important question is how much load is this site going to be under, a few users? 另一个重要的问题是,几个用户将使该站点承受多少负载? a hundred, a million?! 一百,一百万?!

如果您使用的是Web服务,我认为它是无法实现的,因为它始终是同步的。

Have you looked at Jabber (XMPP)? 您是否看过Jabber(XMPP)? Your need seems tailor-made ie you can trigger a send based on certain events etc. plus stateful data transfer etc. 您的需求似乎是量身定制的,即您可以根据某些事件等触发触发发送,再加上有状态的数据传输等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM