public MainForm() { InitializeComponent(); timerMain.Interval = 1000; timerMain.Enabled = false; satellitePower = new SatellitePower(); foreach (IPAddress ip in Dns.GetHostEntry(Dns.GetHostName()).AddressList) { if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) { localIP = ip; break; } } udpSolarPanel = new UdpClient(new IPEndPoint(localIP, localPort)); }