Silverlight 3 Polling Duplex Chat and Realtime Stock Updates
| By Peter Bromberg Printer Friendly Version View My Articles |
![]() |
An extension of the “End to End duplex sample” to show how Duplex polling can use the “push” model to send subscribed realtime stock price updates to connected clients.
I was asked to prototype something with the Duplex Polling feature of Silverlight 3 for some new Silverlight applications we’re working on for eggheadcafe.com. So, like any good developer, the first thing I did was set out not to have to reinvent the wheel. I found several good examples of duplex on the web, but the one that best suited my needs was the “Duplex End to End Sample”. This is a well-written simple chat service that also sends out a fake random stock price update using the “Push to all clients” model.
The stock update was interesting; I figured I could learn more about Silverlight duplex while at the same time turning this into something more realistic that could be tested with multiple clients to measure performance issues. So what I came up with was the idea that you could send a chat message, “subscribe MSFT” or “subscribe IBM”. The service would then store this in such a way that it would be able to retrieve realtime stock quotes, and then using the push model, it would send out the updates for each stock to every client who had “subscribed” to updates for that stock. more here


