You first need to ask yourself a few questions:
- Is my client a web browser or an executable?
- How many clients will be connecting to my server?
- How often are the clients going to be sent data?
- How important is it that the clients receive the data immediately (as opposed to a second or two delay)?
If your client is a web browser then your options are more limited, look at Comet for some guidance. As someone else mentioned, here s a good blog post explaining how to do Comet with ASP.NET.
If you are not expecting many clients then opening connections from the client to the server can be a viable solution, take a look at these MSDN pages for information and a basic example:
- TcpListener
- TcpClient
If you re expecting many clients (more than 50 depending on your server hardware) then your options depend on the answers to the other questions:
If your clients get data frequently and short (seconds) delays are acceptable then polling is an easy solution, you can hide the implementation from the client so it appears that the data is being pushed, but in reality there s a thread in the client that is polling every few seconds.
If your clients don t get data very frequently then something like Comet can be a good option, do a search for "Long Polling WCF" if you re looking for a .NET solution.
Update:
Since you ve now stated that your client is Silverlight I would strongly recommend these blog posts, talks about something like what you re after:
- Sending data from the server using sockets (here, here and here)
- Sending data using WCF Duplex Service (here and here)
The WCF Duplex Service is nicer in that it uses set messages and responses, so there s no need to parse text or binary data yourself. It s basically a version of Comet for Silverlight.