views:

266

answers:

1

Hello,

My windows mobile application (written in C# with the compact framework) needs to know if a particular machine is active or not.

To achieve this goal, I thought to use a ping mechanism. I tried to use the Ping class implemented in the opennetcf framework (the System.Net.NetworkInformation.Ping class for the .NET Framework is not part of the compact framework).

Because I give to the Ping.Send function a host name, it first tries to resolve this host name and to retrieve an IP address.

But i observe the following problem : If the first dns resolution fails (because the network is down at this moment), and if the application tries immediately again to send the ping, it fails too, even if the network is note down anymore. I check with a famous network protocol analyzer and i saw that only the requests concerning the first dns resolution are sent. The requests concerning the dns resolution of the second ping are not sent.

Why is the second dns request not sent ? Is there any dns cache mechanism on such Windows Mobile devices ? If yes, can this mechanism beeing flushed programmatically ?

EDIT : I gave up finding a solution to this DNS flush. I chose to ping an IP adress instead of a name machine. The problem of pinging an hard coded adress IP is that we have to be 100% sure that this IP will not change. The gateway IP can be used because it's always reachable (if it does not, it means the network is down).

A: 

This is a good question and took some digging

I know this answer may be late, but give it a try

http://social.msdn.microsoft.com/Forums/en-US/vssmartdevicesnative/thread/7eda3979-6424-4702-89f4-1f586b613b01

dirtmike