I have updated my Cobra board and my development environment.
I am experiencing some problem with my project.
I have a WebServer (using HttpListener) and it freezes randomly.
When this happens the system is hanging( I have to hard reset the board).
(Needless to say that the same code with 4.1 was running perfectly)
Is there a problem with the HttpListener?
I also tried to get time using NTP: hanging every time
TimeServiceSettings NTPTime = new TimeServiceSettings();
NTPTime.AutoDayLightSavings = true;
NTPTime.ForceSyncAtWakeUp = true;
NTPTime.RefreshTime = 3600;
After a few trial of running my application; it seems like the IP stack is faster, but unfortunately not stable. Meaning that when a problem occurs the the system hangs. and only a hard reset should be applied before deploying a new version.
So, sadly, my question is is it safe to roll back to 4.1?
If the answer is yes, then how should proceed?
@ AniDavid - We must use lwip instead of RTIP so if there are problems then we need to fix them or report them to Microsoft to get them fixed.
Could you please give has simple code that isolate and show the problem? It should use plain .NET Sockets (no Http class or other higher level classes. Because those classes are the same no matter the TCP/IP stack).
I did not get to use plain .NET Sockets. So maybe I was wrong blaming the IP stack. As I mentioned before I use an HttpListener class for the WebServer, and the system hangs after a few minutes. I did some Debug.Prints and found out that there is no consistancy, the system would hang randomly while serving the page. I managed to make it more stable by adding delays between reading the files from the SD card and sending them over context.Response.OutputStream, which bought me a few minutes more but that’s it.
However there is a piece of code that would reproduce a system hang each time:
I wanted to bump this thread… I think I’m suffering from the same problem (hang) that is described in this thread. I’m using 4.2 and .NET Spider. The hang seems to occur after TimeService.Start(); using the same basic code as documented in this article. Did anyone find a workaround besides falling back to 4.1?
Then, I went on and created a new .NET MF 4.2 project. Added the ethernet_j11d module. Wired it up (physically and virtually). Wrote a little code to enable the module (DHCP). Added an event handler to the Network Address Changed event; caught the assigment of my IP and tried configure and start the time service. But I still get a hang. Maybe I need to let it spin longer, but I thought this was fixed. By time service, I mean Microsoft.SPOT.Time.TimeService.