Hi all.
I'm currently working on an app that requires the need to ping pc's to check that they are online. The app could pottentially have to check several hundred PC's, and so I've made it a multithreaded application. The problem I'm having is that the code that microsoft suggests for performing a ping is not really thread safe. I've also looked at ready made controls, and they dont seem to work either.
The problem I am getting is this:
Ping 2 IP Addresses, one of which is a PC, the other isnt (no device at all). Assuming that both ping requests are made at the same time (which seems to happen in my app), I get a response from IP address 1 (as I should), but I also get a respone from IP address 2 even though there is no device on this IP address! - Im guessing that the second thread is seeing the response from IP address 1 and not working out that it isnt a response from its own ping request.
I can include the code I'm currently using if needed - but it is a bit long.
Anyone have any ideas or suggestions?
Thanks
Jeff.
I'm currently working on an app that requires the need to ping pc's to check that they are online. The app could pottentially have to check several hundred PC's, and so I've made it a multithreaded application. The problem I'm having is that the code that microsoft suggests for performing a ping is not really thread safe. I've also looked at ready made controls, and they dont seem to work either.
The problem I am getting is this:
Ping 2 IP Addresses, one of which is a PC, the other isnt (no device at all). Assuming that both ping requests are made at the same time (which seems to happen in my app), I get a response from IP address 1 (as I should), but I also get a respone from IP address 2 even though there is no device on this IP address! - Im guessing that the second thread is seeing the response from IP address 1 and not working out that it isnt a response from its own ping request.
I can include the code I'm currently using if needed - but it is a bit long.
Anyone have any ideas or suggestions?
Thanks
Jeff.