473,666 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Recreating Ping in .Net Problems

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 that are even close the the
actual ping command line utility. For example:

If i would ping the same server over and over, some pings would come back in
0 milliseconds, others would come back in 15, but never in between. It would
always jump between the two. The real ping utility would consitently return
in 5-6ms for the same host but I could never get that kind of precision or
consistency. What does the real ping utility do different to get those kind
of results?

Any thoughts?

Here are some of my sources:
http://support.microsoft.com/default...b;en-us;828993
http://www.eggheadcafe.com/articles/20020209.asp
http://www.c-sharpcorner.com/network/ping.asp
http://www.csharphelp.com/archives/archive6.html
http://www.ftponline.com/vsm/2002_03.../qa/page2.aspx
http://www.mastercsharp.com/article....59&&TopicID=14
Jul 21 '05 #1
3 2247
Well, you could always use the commandline ping, hack that this idea is..

exec master..xp_cmds hell 'ping www.server.com'

or shell ping www.server.com > out.txt

"Jason Rodman" <Jason Ro****@discussi ons.microsoft.c om> wrote in message
news:32******** *************** ***********@mic rosoft.com...
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 that are even close the the actual ping command line utility. For example:

If i would ping the same server over and over, some pings would come back in 0 milliseconds, others would come back in 15, but never in between. It would always jump between the two. The real ping utility would consitently return in 5-6ms for the same host but I could never get that kind of precision or
consistency. What does the real ping utility do different to get those kind of results?

Any thoughts?

Here are some of my sources:
http://support.microsoft.com/default...b;en-us;828993
http://www.eggheadcafe.com/articles/20020209.asp
http://www.c-sharpcorner.com/network/ping.asp
http://www.csharphelp.com/archives/archive6.html
http://www.ftponline.com/vsm/2002_03.../qa/page2.aspx
http://www.mastercsharp.com/article....59&&TopicID=14

Jul 21 '05 #2
Jason,
I went through this mess recently. Send me your email address and I'll send
you some code. It may be what you already have but it's worth a look.
-Mike

"Jason Rodman" wrote:
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 that are even close the the
actual ping command line utility. For example:

If i would ping the same server over and over, some pings would come back in
0 milliseconds, others would come back in 15, but never in between. It would
always jump between the two. The real ping utility would consitently return
in 5-6ms for the same host but I could never get that kind of precision or
consistency. What does the real ping utility do different to get those kind
of results?

Any thoughts?

Here are some of my sources:
http://support.microsoft.com/default...b;en-us;828993
http://www.eggheadcafe.com/articles/20020209.asp
http://www.c-sharpcorner.com/network/ping.asp
http://www.csharphelp.com/archives/archive6.html
http://www.ftponline.com/vsm/2002_03.../qa/page2.aspx
http://www.mastercsharp.com/article....59&&TopicID=14

Jul 21 '05 #3
Dan
I recall trying out an open source ICMP implementation done using C# and it
seemed nice and quite stable.

http://freshmeat.net/projects/icmplibrary/

Hope this helps,
Dan

"Jason Rodman" wrote:
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 that are even close the the
actual ping command line utility. For example:

If i would ping the same server over and over, some pings would come back in
0 milliseconds, others would come back in 15, but never in between. It would
always jump between the two. The real ping utility would consitently return
in 5-6ms for the same host but I could never get that kind of precision or
consistency. What does the real ping utility do different to get those kind
of results?

Any thoughts?

Here are some of my sources:
http://support.microsoft.com/default...b;en-us;828993
http://www.eggheadcafe.com/articles/20020209.asp
http://www.c-sharpcorner.com/network/ping.asp
http://www.csharphelp.com/archives/archive6.html
http://www.ftponline.com/vsm/2002_03.../qa/page2.aspx
http://www.mastercsharp.com/article....59&&TopicID=14

Jul 21 '05 #4

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

Similar topics

0
7768
by: Ed | last post by:
I've attached some VB.NET code I've hacked together (some taken from MS examples & newsgroup postings) that will perform a ping or IcmpSendEcho using the icmp.dll (see this for more info: http://support.microsoft.com/default.aspx?scid=kb;en-us;170591 ). The problem I have is in order to perform a discovery/ping of an entire subnet (192.168.1.* for instance) I have to do a FOR loop to itterate through all of the addresses. That it seems...
3
295
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 that are even close the the actual ping command line utility. For example: If i would ping the same server over and over, some pings would come back in 0 milliseconds, others would come back in 15, but never in between. It would always jump...
21
30513
by: Neel | last post by:
I am trying to "ping" a remote host in my C++/Redhat Linux code to check whether that host is connected or not. if (0 == system("ping -w 2 192.168.0.2)) But, in both cases (connected/disconnected), system call returns 0. Can someone please show what I am doing wrong? How to check the actual result of the ping status using C++ on Redhat linux ? Thanks in advance.
7
7256
by: luvwknd | last post by:
Hi all, I am attempting to utilize MS's article I.D. #828993 found at: http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B828993 In an effort to create a GUI Ping utility that ultimately will show me via a green indicator if a system is pingable and a red indicator if a system is not pingable. In addition I want to be able to ping a range of addresses at one time and have the program return my indicators.
5
5581
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 be executed and then continue pinging another certer. The ping_completed function is called on completion of ping by the os and i have no control on it .
1
18480
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 whether the application is able to access the webservice. If the webservice is accessible, the application is online. otherwise it is offline What is the best way to ping a url in C# ?
3
1831
by: amaccormack | last post by:
I wrote a quick script to check the "up-ness" of a list of machines, and timeout after 1 second. However, with a lot of timeouts, the script takes a logn time, so I thought to parallelise it. However, as soon as I do, the pings that do not get a response never return, so their threads block forever and the program hangs. Environment is: Python 2.3.3 (#1, Jan 5 2005, 15:24:27) on linux2 (running on SLES9) pinglist=
2
3954
by: adnanahmed714 | last post by:
hi 1) i am using a home network consisting of two computer.on One pc i have Marvell Lan card(built-in on the board) and on the second pc i have BayLan network adapter. What i know if two pc's are on the same network they ping each other easily.But i my case Pc with Baylan ping the Marvell's Pc but Marvell Pc does not ping the BayLanPc.?(ALso used a Switch in between but result is same) 2) i attach a laptop to Marvell'sPc direct and...
6
3454
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 wondering if anyone has a ping function they could share with me. I have done some searching on this but cannot find anything specifically for vb2003. Sub PingComputer If PingStatus(PCName) = "Success" Then
0
8444
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8551
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7386
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1775
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.