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?