473,396 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Ping vs. SocketException

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).HostNa me and catch the
exception ?

Thanks

Jun 29 '06 #1
3 2018
Yeap, if you know their IP, I bet ping is still a good way even it is a bit
of traditional.
http://msdn2.microsoft.com/en-us/lib...ng(d=ide).aspx

chanmm

"schaf" <sc***@2wire.ch> wrote in message
news:11********************@x69g2000cwx.googlegrou ps.com...
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).HostNa me and catch the
exception ?

Thanks

Jun 29 '06 #2
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.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"schaf" <sc***@2wire.ch> wrote in message
news:11********************@x69g2000cwx.googlegrou ps.com...
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).HostNa me and catch the
exception ?

Thanks

Jun 29 '06 #3
schaf wrote:
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).HostNa me 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
Jun 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jason Rodman | last post by:
I have downloaded every example on how to create a ping utility in .Net in both VB and C#, but have been disappointed with the results. I have YET to find an example that returns consistent results...
0
by: oferns | last post by:
Hi, apologies for the cluncky title.... Using WinXpSP2 & VS2005 Express editions..... I am writing an asynchronous socket client and I am getting a SocketException error on creating the...
5
by: Deepak | last post by:
I am programing a ping application which pings various centers . I used timer loop and it pings one by one. Now when i finish pinging one center it should wait for the ping_completed function to...
1
by: Krish | last post by:
All, I have an offline application that works online for some data syncronization. For data syncronization I access a webservice. I want to show whether my application is online or not by checking...
6
by: Dave Marden | last post by:
I currently use this routine in vbscript to ping computers and get the status of ping to determine whether to try to backup a machine, I am trying to change it to work with vb2003.net I am...
1
by: wesomon99 | last post by:
Hello, I have a JBoss web application (v4.04GA), run on an Apache Tomcat HTTP server (v5.5.17). It connects with a MySQL database (v4.1.10). My web application takes an XML file, creates a CSV file...
2
by: XenReborn | last post by:
Hi, I wrote a simple socket application, which connects to a simple socket server application I also wrote, the server opens a socket, listens, accepts connections, sends back a string of...
0
by: selvialagar | last post by:
i did a program in vc++.net for ICMP communication using sockets.But when i execute it i received a very slow response...is there any configuration to be made on the server..or any other thing?.. i...
4
by: Newbie | last post by:
Is it possible, without any 3rd party tools to simply ping an ip address, and get back if the ping was sucessfull. Thanks
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.