May 2011
Beginner
194 pages
3h 46m
English
In this chapter, I will present a version of a complete Pachube client that uses the Socket API. It demonstrates that this low-level API is a viable alternative, especially for “fire and forget” requests.
HelloPachubeSockets (Example 9-1) performs some initializations in its Main method, enters an endless loop in which it waits until it is time for the next measurement, performs the measurement, and then sends the result to Pachube. This is repeated every 20 seconds like in the original HelloPachube program.
using System; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; ...
Read now
Unlock full access