Restart connection after Cerbuino has its network cable removed


I have some cerbuino’s in my network wich all connect to a central socket server over tcp/ip
every cerbuino has a unique fixed ip.

First I successfully setup my network with:

NetworkChange.NetworkAvailabilityChanged += new NetworkAvailabilityChangedEventHandler(Ethernet_CableConnectivityChanged);

ethernetInterface = new EthernetENC28J60(Microsoft.SPOT.Hardware.SPI.SPI_module.SPI1, Generic.GetPin(‘A’, 13), Generic.GetPin(‘A’, 14), Generic.GetPin(‘B’, 10));

ethernetInterface.NetworkInterface.EnableStaticIP(State.McSetting.IpAddress, State.McSetting.Subnet, State.McSetting.Gateway);

from that moment I can ping my cerbuino.

My cerbuino connects to the server, and reconnects after the connection is lost, perfect!

But! when the networkcable is pulled I do get a NetworkAvailabilityChanged event, and when I reinsert the cable I also get a NetworkAvailabilityChanged event.

But When I try to connect again, I keep getting a System.Net.Socket.SocketException.

Do I need to restart my network somehow? Any tips?

@ dohmenict - Can you post a complete example that shows the issue?

yes. but first let me try if updating the sdk from to helps… :-[

@ dohmenict - It might, there were a lot of network improvements after

Update did the trick! 8)