Question

I am a project engineer and I am working on a multiplexer system and I am now writing the software to control the system using visual basic 2010 as the company won't spend the money for a profession software developer. The main program is working very well but I have a quick question for people that are much more experienced. I have 10 x Ethernet devices within my system (topside and subsea) that I need to monitor the connection status of.

The way I am going about this is pinging each IP address in sequence over and over in a loop and if it is connected/disconnected I change a pitcurebox from an imagelist control to show the connection status. This is done in a new thread to stop the main interface from becoming unresponsive and it all works but is slow to update of course, so...

My question to you guys is there a better way of showing connected/disconnected IP addresses on the system? I have searched the internet but everything I find isn't quite what I'm looking for, or I'm just sh*te at searching.

Thank you for your time.

Was it helpful?

Solution

Since you are using an UI-application, have a look at the Ping-class as well as the async method for pinging, depending on your normal ping times and how heavy the network traffic is I would change the ping time, but at least once a second is needed.

In the form use a timer which calls some method, ex async void UpdateMachineStatus(IPAdress adr) which awaits the call to the pinger, ie var result = await Ping.SendPingAsync(adr), and then does something. This would use a non-blocking wait and would not cream system resources.

Harness the power of async!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top