rmorgan001 / GSServer

ASCOM Synta protocol driver for SkyWatcher and Orion telescope mounts
GNU General Public License v3.0
40 stars 16 forks source link

GSS beta SkyTelescopeVM.cs InitializeUdpClients() does not work correctly #50

Closed Principia4834 closed 11 months ago

Principia4834 commented 11 months ago

The LINQ query to populate the networkIfaceIps var has a couple of problems:

var networkIfaceIps = NetworkInterface.GetAllNetworkInterfaces() .Where(ni => ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet || ni.NetworkInterfaceType == NetworkInterfaceType.GigabitEthernet || ni.NetworkInterfaceType == NetworkInterfaceType.Loopback || ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || ni.OperationalStatus == OperationalStatus.Up && !ni.IsReceiveOnly) .SelectMany(ni => ni.GetIPProperties().UnicastAddresses, (ni, ip) => new { ni, ip }) .Where(@t => @t.ip.Address.AddressFamily == AddressFamily.InterNetwork) .Select(@t => @t.ip.Address);

It is easy to extend the IPAddress type with a custom comparer (see stack hub and others) but probably not needed.

Andy

rmorgan001 commented 11 months ago

should be okay now, thanks

rmorgan001 commented 11 months ago

closing