Im building and testing this using the emalator. Without a while(true) the application quits. Is this what I should be doing? Is there a better way to keep the program running and not just drop out?
Thanks!
using System; using System.Net; using System.Net.Sockets; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.NetduinoPlus; using MFToolkit.Net.Web; namespace WebServer { public class Program { public static void Main() { using (HttpServer httpServer = new HttpServer(8080, new MyHttpHandler())) { httpServer.Start(); } } } public class MyHttpHandler : IHttpHandler { public void ProcessRequest(HttpContext context) { BuildHttpResponse(context.Response); } public void BuildHttpResponse(HttpResponse httpResponse) { httpResponse.HttpStatus = HttpStatusCode.OK; httpResponse.WriteLine("Hello World"); } } }