Chapter 4. Web Messenger

The Gadgeteer with an Ethernet module can be put to work as a small web server. In this project, the web server constantly serves the contents of the Gadgeteer screen. You can draw sketches on the screen with your finger or a stylus and leave messages for the world to see, as shown in Figure 4-1.

All components, apart from the network patch cable are all included in the Fez Starter Kit. You can get the patch cable from any computer store.

Once you have downloaded the zip files for the projects from the book’s website (http://www.gadgeteerbook.com/downloads) you will need to unzip them into your Gadgeteer’s projects area which is usually My Documents\Visual Studio 2010\Projects\. You can then open the project by opening the File menu and selecting “Open Project..” from Visual Studio’s menu.

Web Messenger

Figure 4-1. Web Messenger

Web Servers

Before we look at making our own web server, it is perhaps worth recapping exactly how a web server works.

A web server is a computer whose job it is to wait for a browser to request a URL from it and then to respond to it (see Figure 4-2).

Web Servers

Figure 4-2. Web Servers

The response will be in the form of a stream of text formatted as HyperText Markup Language (HTML). HTML contains both text to be displayed and formatting that controls its appearance in the browser.

Get Getting Started with .NET Gadgeteer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.