Hi all
I am having a problem when trying to the the sample network code. It fails on the line that says Socket clientSocket = server.Accept()
I get the following error:
#### GHIElectronics.NETMF.Net.SocketNative::accept [IP: 007f] ####
#### GHIElectronics.NETMF.Net.Sockets.Socket::Accept [IP: 0023] ####
#### MySocketServer::Main [IP: 00d8] ####
A first chance exception of type ‘System.Exception’ occurred in GHIElectronics.NETMF.W5100.dll
An unhandled exception of type ‘System.Exception’ occurred in GHIElectronics.NETMF.W5100.dll
Additional information: Fail[invalid ip,port]
Below is my code, can anybody help? I’ve been trying everything without any luck.
public static void Main()
{
byte[] mac = { 0x90, 0xA2, 0xDA, 0x00, 0x43, 0x97 };
WIZnet_W5100.Enable(SPI.SPI_module.SPI1, (Cpu.Pin)FEZ_Pin.Digital.Di10, (Cpu.Pin)FEZ_Pin.Digital.Di7, true); // WIZnet interface on FEZ Connect
byte[] ip = { 172, 21, 220, 206 };
byte[] subnet = { 255, 255, 248, 0 };
byte[] gateway = { 172, 21, 220, 1 };
NetworkInterface.EnableStaticIP(ip, subnet, gateway, mac);
NetworkInterface.EnableStaticDns(new byte[] { 172, 21, 220, 34 });
Socket server = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Any, 80);
server.Bind(localEndPoint);
server.Listen(1);
while (true)
{
// Wait for a client to connect.
Socket clientSocket = server.Accept();
// Process the client request. true means asynchronous.
//new ProcessClientRequest(clientSocket, true);
}
}