A lot of time, after I start my nic, I have that error every operation I try (for example a dns resolution).
I restart the project, maybe the board, and after one, two, or three times, code runs.
Any idea?
thanks
my code (the exeption is raised executing GetHostEntry, but is same if I open a socket, I try and http connection, and so on):
Dim eth1 = interfaces(0)
Dim r As New Random
Dim mac(48 - 1) As Byte ' = {&H0, &H88, &H50, m1, m2, m3}
r.NextBytes(mac)
eth1.PhysicalAddress = mac
Thread.Sleep(100)
Dim netConfiguration = _sd.GetConfigurationNetwork()
eth1.EnableStaticIP(netConfiguration.Address, netConfiguration.Subnet, netConfiguration.Gateway)
eth1.EnableStaticDns(New String() {"208.67.222.222", "208.67.220.220"})
Thread.Sleep(100)
Dim d = System.Net.Dns.GetHostEntry("www.google.com")
IsNetworkRunning = (d IsNot Nothing AndAlso d.AddressList.Length > 0)