Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add Network up check
Fix crash when network is down.
Checks first if network is up before sending data
  • Loading branch information
remco1271 authored Mar 17, 2022
commit f2316a6038ca9b54b17b4959eafa2a2d8d957555
2 changes: 1 addition & 1 deletion EEIP.NET/EIPClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public class UdpState

foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
{
if (ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
if ((ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet) && ni.OperationalStatus == OperationalStatus.Up)
{

foreach (UnicastIPAddressInformation ip in ni.GetIPProperties().UnicastAddresses)
Expand Down