Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

phil

Member Since 11 Aug 2010
Offline Last Active Feb 21 2014 06:54 AM
-----

Topics I've Started

Crash on network socket unplug

28 September 2011 - 08:25 AM

Does anyone has any idea why a Netduino plus crashes out if the network cable is removed and then plugged back in?

In simple terms, my app is:

void Main()
{
  try
  {
     while (!button pressed);

     Connect to tcp server
     send message to tcp server
     poll for response
  }
  catch (Exception)
  {
     Print error
  }
}

Now, if I stop the tcp server and press the button, no sweat - the catch triggers on the send failure and then eventually
recovers when the server is restarted.

But if I pull the network cable it bombs right out .. no exception. I know it's dead as I have a threading.timer running flashing the LED each second. It just dies when the network cable is out and I press that button... Tracing the code, it seems to die at a Socket.Connect call.

I can't see any obvious way to detect if the cable is in .. if there was a way to do that I could avoid the connect call.

This is firmware 4.1.0.6

Big problem for me. I wanted to use the netduino pluses in a production environment but if they can't survive a cable pull or switch reset, then they're no good to me.

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.