views:

53

answers:

2

Suppose I have either an ASP.NET displaying my results, or a Silverlight client. And I'd like to show the current status of my server, or embedded device. (pretend the device reads temperature and humidity stats)

How should I send the status information from my device to the front end? Should I poll the device and save the results to SQL, Azure Table, or the like? (Azure is a technology that fits with this project for other reasons. That's why I mention it)

Or should I create a WCF service that polls the device directly and returns the current status.

What makes more sense?

A: 

In either ASP.NET or Silverlight you are going to have to poll from the client (web page or Silverlight app) to the backend to get the current status. In ASP.NET I'd look into doing this via an AJAX poll to a service using Javascipt (look at using Jquery or something similar to make this easier).

In silverlight you will need to have some sort of service configured to return the results and poll it using the Timer control running on a seperate thread.

bechbd
using ASP.NET I would suggest using PageMethods. Simpler code all things considered.
drachenstern
What should the backend be? The device itself, or a middleman such as SQL?
MakerOfThings7
PageMethods are another option but its not all that hard to code a simple web service using Jquery and ASP.NET. The advantage of the web service is it can also be called by other programs if needed such as if you wanted to make a mobile app.
bechbd
The backend really depends on the specific nature of the problem. SQL or Azure would be great if you wanted to record historical data for later analysis. Hitting the device would be fine if you only need an instantaneous reading. The answer as far as which method to choose is really highly dependant on what sort of device your polling and what the data is going to be used for
bechbd
A: 

You can also using a "push" binding within your silverlight app. Basically instead of you manually polling the server, the server will send you a push notification anytime it deems it necessary to let the client know of any change.

AlvinfromDiaspar
Is this the HTTPDuplex binding? I think I remember reading an article saying that this was a very unscalable option on the server. It applied to Silverlight 3.x not sure if it still applies today
MakerOfThings7