I have a requirement to monitor the client system connected to a LAN Network. If a system gets connected to a LAN , i need to get a notification and if a system gets disconnected from LAN, i need to get a notification.
Currently i am pinging the systems continuously in a C# code and getting the things done.
Drawbacks :-
1.I hard coded the system names to ping.
2.If the client is not reachable/ not in LAN / Host not found, the ping method waits for a period and throws exception.
3.So to to do this in Background, i perform this function in a thread.
4.Calling that thread inside a timer.
What is the best way to achieve this ?
ESSENCE
Some event , it should notify on new incoming connections,
connection which is getting lost from LAN. This event should run async, monitor
continuously.
I am using Windows Application (WPF) , C#.