I've a netduino board that is used to control my home gate.
The Netduino+2 has the following "subsystems" running
- a mail client to send e-mail alarms
- a ping client to probe internet gateway
- a web server to acceess board commands from the internet
The ping client and the web server runs both in his own thread, while the mail client is called from within one of the two threads above.
What happens is that if I connect to the webserver from a client that uses wired LAN all goes Ok, if I use the same client from wifi or a phone through the internet in after few commands (1 or 2) the web server stops responding but no exception is thrown in the code:
CLIENT LAPTOP ---> GIGABIT-SWITCH ---> NETDUINO
CLIENT LAPTOP ---> WIFI-ROUTER ---> GIGABIT-SWITCH ---> NETDUINO
ANDROID PHONE (3G) ---> WIFI-ROUTER ---> GIGABIT-SWITCH ---> NETDUINO
The problem appears with the above config when
- the webserver and ping thread runs, and no mail is sent
- the webserver runs, the ping is stopped, mail are sent (at each web command)
the problem seems much much minor is webservr runs "alone"...
Does anyone have an idea on what the problem could be ? or which kind of workaround could I implement ?
The only one I've tought is to shutdown/restert the webserver socket if does nobody connects... but this seems really a brute and bad thing to do in a system that should run 24/7 !
I can also post the full source code if someone wants to experiment...