| By Kevin Hoffman | Article Rating: |
|
| September 8, 2009 09:00 AM EDT | Reads: |
1,700 |
First, let's talk about the problem that Polling Duplex solves. Polling Duplex is a special WCF channel that is available only to Silverlight. When your Silverlight application needs data from the server, it needs it in one of two different ways:
- On-Demand : Something in your application happens and it needs data. It specifically asks the server for that data upon encountering the need for that data. This is what most people think of as "pull" data.
- Push : This is where you need data sent to your application as the data becomes available and the overhead of setting up a timer on which you pull (or poll) for data is unacceptable to you. The main reason why this is unacceptable to people is because there may be frequent periods of time where the pull/poll has no data, which means your app will be occupying server resources every X seconds even when there is nothing to do.
The Polling Duplex channel is a solution to the push problem. It allows server-side code to "push" data down to the Silverlight application. Under the hood the channel is using "Comet"-style tricks keeping HTTP connections open in much the same way that the Gmail application is able to receive push notifications of new mail.
This is great and the programming model for communicating with the Polling Duplex channel is brain-dead simple. It does NOT get any easier to implement push data to a RIA - not in Flash, not in AIR, and certainly not in JavaFX. The problem is that this solution doesn't scale. On the server side, for each concurrently running Silverlight application (so probably one per concurrent user), there is a full live socket being consumed that will not be relinquished until the client disconnects/closes their browser.
Worse is that the Polling Duplex channel defaults to only allowing 10 concurrent connections. You can programmatically tweak that by configuring the throttling behavior (as shown in this blog post here ).Even if you do increase the amount of concurrent connections allowed, those concurrent connections are still going to beat the crap out of your servers and good luck getting that to work seamlessly in a cluster/farm scenario.
If you need more than a handful of concurrent users and you want to do it in a way that scales and doesn't abuse your servers, then I highly, highly recommend looking into some kind of messaging / open gateway server. The only one I've played with for more than a few minutes is Kaazing , but I have nothing but good things to say about it. It's based on HTML 5 Web Sockets so you will be in good shape for the future.
Web Sockets are freaking awesome but that's a topic for another post.
Bottom line here is that if you're looking at any of the Polling Duplex samples online like the "stock ticker" sample, don't be fooled. It looks easy, but especially in the financial industry, you need high concurrency, high speed, low latency - and you're not going to get that with the polling duplex channel. If there was one place where I see it fitting is in the creation of intranet applications internal to an organization with a limited number of concurrent users.
Read the original blog entry...
Published September 8, 2009 Reads 1,700
Copyright © 2009 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Kevin Hoffman
Kevin Hoffman, editor-in-chief of SYS-CON's iPhone Developer's Journal, has been programming since he was 10 and has written everything from DOS shareware to n-tier, enterprise web applications in VB, C++, Delphi, and C. Hoffman is coauthor of Professional .NET Framework (Wrox Press) and co-author with Robert Foster of Microsoft SharePoint 2007 Development Unleashed. He authors The .NET Addict's Blog at .NET Developer's Journal.
- Kindle 2 vs Nook
- Installing Geneva Beta 2 on Windows 7
- Binary Serialization and Azure Web Applications
- Get Your Red Hot VS2010 Beta 2
- Templated Helpers in ASP.NET MVC 2 (VS2010 Beta 2 Version)
- LINQ to SQL and Entity Framework on top of SQL Azure
- Working with Table Storage on the Windows Azure
- ADO.NET Data Services Projections Makes Sliced Bread Jealous
- Creating and Manipulating Your SQL Azure Database
- Setting up an ASP.NET MVC 2 Application for Windows Azure
- Breaking Changes for .NET Services in Azure
- Windows Identity Foundation (WIF) Release Candidate Is Out
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- ASP.NET Membership Provider in the Cloud
- Installing Geneva Beta 2 on Windows 7
- Binary Serialization and Azure Web Applications
- Get Your Red Hot VS2010 Beta 2
- Templated Helpers in ASP.NET MVC 2 (VS2010 Beta 2 Version)
- LINQ to SQL and Entity Framework on top of SQL Azure
- Using ASP.NET MVC Action Filters to Declare Reference Data for Views
- Creating Correlated Workflow Services in WF4 / .NET4 : Part 1
- Working with Table Storage on the Windows Azure
- ADO.NET Data Services Projections Makes Sliced Bread Jealous
- Want to Learn How to Write iPhone Applications?
- iPhone Will Make Mobile AJAX and Web 2.0 Happen
- Will Silverlight Be DOA?
- Why Build Applications for the iPhone and iPod Touch?
- Silverlight 2 - Adobe Flex Killer Is on Its Way!
- Why Is iPhone Better? Here's My Story...
- Silverlight and Astoria - First Impressions
- iPhone Developer Summit 2008 East
- Is the Silverlight Adoption Rate Artificially Inflated?
- iPhone with High-Speed G3 Support at Macworld
- Will Google's Android Sink or Swim?
- iPhone Price Cut? Here is My Objective View on This!


























