Ping vs. SocketException

  • Thread starter Thread starter schaf
  • Start date Start date
S

schaf

hi NG !
My app knows the IP address of a remote computer from App.exe.config.
What's the best way to check if this pc in on the network ?

Ping ?
or Dns.GetHostByAddress(sRemoteHostDefinition).HostName and catch the
exception ?

Thanks
 
Hi,

A ping is a good solution to know if that IP is in the network.

A better solution would be if you have some way to know if the remote
machine is running the program or service you want.
 
schaf said:
hi NG !
My app knows the IP address of a remote computer from App.exe.config.
What's the best way to check if this pc in on the network ?

Ping ?
or Dns.GetHostByAddress(sRemoteHostDefinition).HostName and catch the
exception ?

Doesn't the WinXP firewall block pings (icmp echo requests) by default?
If you have control over the remote PC and can disable that setting, I'd
go for ping too.

Max
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top