Real-time/Push Data to HTML with Sockets and Silverlight

by marc 18. March 2008 10:07

Silverlight is, of course, great for providing a rich UI. But as it brings the power of .NET to the browser, it is interesting to consider how it can be used to enhance a web page in other ways. I've put together a quick 'Marchitecture' on doing just this...

The article and demo explains how to use a ‘headless’ Silverlight 2 solution to deliver ‘real-time’ or ‘push’ data into a browser.

HTTP is inherently a pull mechanism: make a request, receive a response - and so it is difficult to provide real-time data to an HTML page. Some of the limitations of HTTP can be overcome through the use of a long-lived HTTP connection allowing the streaming of real-time data to a client browser. This solution is an unconventional use of HTTP and may suffer from reliability problems. The following pattern describes ‘HTTP Streaming’: http://ajaxpatterns.org/HTTP_Streaming

Silverlight 2 has socket-based networking capabilities that can be used for this task in a more appropriate fashion. We could write a Silverlight UI that renders the data from the socket-based service, but we may not wish to amend an existing UI. So, if we combine the sockets capabilities with the Silverlight 2 HTML Bridge means that an existing web site can be integrated with Silverlight to provide true socket-based communication without the need to create a ‘Rich Internet Application’ UI, but still providing the ‘push’ capability.

image 

Read the whole thing and download from here.

Comments

Powered by BlogEngine.NET 1.4.5.0
Original Theme by Mads Kristensen and adjusted by me
Google Analytics Alternative

Clicky