views:

149

answers:

4

Hello everyone, 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.

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. I make a trick: Each client will send request to server each 2 seconds once to check that server has new data or no. If yes, client will receive data. I need a new solution to replace.

Thanks.

+1  A: 

If you are using web services I think it can't be accomplished since it is always synchronous.

Jojo Sardez
They can be asynchronous with a little work.
Paul Creasey
+2  A: 

Well you need to start by asking yourself and important question, is a 2 second poll interval really a requirement? 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.

Another important question is how much load is this site going to be under, a few users? a hundred, a million?!

Paul Creasey
I was totally thinking web application, but if this is a winforms/wpf app, then i defer to willbt.
Paul Creasey
I prefer to use long polling. When client is connected to server, it will listen and when server has new data, server will send to client, and client will operate with these new data.P/S: My application is a real-time stock terminal, with a million of users. The client is a WinForm application. The server is a window service. Obvious, in trading time, server will always have new data (real-time data). But after hours trading, server will don't have new data.
Lu Lu
+3  A: 

Take a look at Duplex WCF Services

Word of warning, this does not work over https.

Alternatively the Windows Azure Service Bus also supports Duplex communication.

willbt
A: 

Have you looked at Jabber (XMPP)? Your need seems tailor-made i.e. you can trigger a send based on certain events etc. plus stateful data transfer etc.

Mikos
no need for polling...
Mikos