Hi,
using GHIElectronics.NETMF.W5100.Http library but i have no mamed problem. used code and debug output is bellow. code is do nothing and waiting infinite when context.Response.Headers.Count.ToString(); called. Whats wrong?
namespace OMR.MyHttpServer
{
using GHIElectronics.NETMF.Net;
using GHIElectronics.NETMF.Net.NetworkInformation;
using Microsoft.SPOT;
public class Program
{
public static void Main()
{
Debug.Print("Network interface initializing...");
InitializeIp();
StartHttpServer(80);
}
private static void StartHttpServer(int port)
{
var hl = new HttpListener("http", port);
hl.Start();
HttpListenerContext context = null;
while (true)
{
context = hl.GetContext();
Debug.Print("on request");
try
{
string str = context.Response.Headers.Count.ToString();
Debug.Print(str);
}
catch (System.Exception ex)
{
Debug.Print("Exception: " + ex.ToString());
}
finally
{
Debug.Print("finally");
}
}
}
private static void InitializeIp()
{
byte[] ip = { 192, 168, 2, 107 };
byte[] subnet = { 255, 255, 255, 0 };
byte[] gateway = { 192, 168, 2, 1 };
byte[] mac = { 0x00, 0x26, 0x1C, 0x7B, 0x28, 0xE8 };
NetworkInterface.EnableStaticIP(ip, subnet, gateway, mac);
NetworkInterface.EnableStaticDns(new byte[] { 192, 168, 0, 1 });
}
}
}
...
'Microsoft.SPOT.Debugger.CorDebug.dll' (Managed): Loaded 'C:\Program Files\GHI Electronics\GHI NETMF v4.1 SDK\Assemblies\le\FEZPanda_II_GHIElectronics.NETMF.FEZ.dll'
The thread '<No Name>' (0x2) has exited with code 0 (0x0).
Network interface initializing...
on request