• We are using .NETMF 4.1
• GHIElectronics.NETMF 4.17
• DPWS_V_4_1_7706_0
• WsHttp configured web services
- When our application starts up we call this method:
private static void EnabledDhcp()
{
try
{
if (!Ethernet.IsEnabled)
Ethernet.Enable();
if (!Ethernet.IsCableConnected)
Site.Net.IsNetworkAvailable = false;
else
{
var network = Site.Net.GetNetworkInterface();
if (!network.IsDhcpEnabled)
network.EnableDhcp();
network.RenewDhcpLease();
}
}
catch (Exception)
{
Site.Net.IsNetworkAvailable = false;
}
}
It was my understanding that this would bind the network stack thus allowing us to subscribe to the following events for detecting network changes/outages. Moreover, it would enable DHCP and create a DHCP lease with the DHCP Server:
NetworkChange.NetworkAddressChanged += networkAddressChanged;
NetworkChange.NetworkAvailabilityChanged += networkAvailabilityChanged;
From what I have seen, these events never fire. Most importantly, we were relying on the NetworkChange.NetworkAvailabilityChanged event to signal changes in network availability. As a result, we are reduced to polling to pre-emptively detect network outages