I chose to change my arduinos with netduinos to add ethernet to my projects. If thought multi-thread can avoid hangs caused by network delay. I was desapointed when I saw my netduino hangs when I unplugged the cable...
I hoped that the netduino hang until the connect timeout raise. I didn't have the time to test it and I really need my input interruption been catch even when I try to send networks request so I let it untouched.
In the test of the first post, is the catching of the exception still in the main loop ?
It seems that Secret Labs is confident about resolving the issue in the next 4.2 firmware, so it may not be an hardware problem. We just have to wait ... RC3 is annonced in few days (weeks ?)
Thanks, Ricco. So, this is a known issue? I've been trying to find info in the forums about betas, etc, but it's really hard to dig through.
This is only an issue where the cable is unplugged when the device is powered on. If the cable is plugged in when it is powered up, you can add some code like this:
static bool networkAvailable = true; void main() { NetworkChange.NetworkAvailabilityChanged += new NetworkAvailabilityChangedEventHandler(NetworkChange_NetworkAvailabilityChanged); while (true) { while(!detect_Event()); if (networkAvailable) { using (socket = ConnectToServer()) { SendMessage(); DoOtherStuff(); } } } } static void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) { Debug.Print("Network Availability Changed : IsAvailable = " + e.IsAvailable.ToString()); networkAvailable = e.IsAvailable; }