We help IT Professionals succeed at work.

visual studio 2010 + getting ping latency from remote computer

1,162 Views
Last Modified: 2012-05-10
I would like to get the ping information (latency) when I ping a remote computer.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
how do i make the source (127.0.0.1) different.  I want to test a ping from a changing source and destination.  
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
You don't have control over the source.  You would have to run the test from that machine.

The Ping class is a wrapper around the IcmpSendEcho2 command:

<DllImport("iphlpapi.dll", SetLastError:=True)> _
Friend Shared Function IcmpSendEcho2(ByVal icmpHandle As SafeCloseIcmpHandle, ByVal [Event] As SafeWaitHandle, ByVal apcRoutine As IntPtr, ByVal apcContext As IntPtr, ByVal ipAddress As UInt32, <[In]> ByVal data As SafeLocalFree, ByVal dataSize As UInt16, ByRef options As IPOptions, ByVal replyBuffer As SafeLocalFree, ByVal replySize As UInt32, ByVal timeout As UInt32) As UInt32
End Function

That function only specifies destination addresses, and not source addresses.

IcmpSendEcho2 Function
http://msdn.microsoft.com/en-us/library/aa366051(VS.85).aspx

Author

Commented:
what can i do to change the source.  is that a add-on for vb that will give me that flexibility?

there are utilities that you can set source and destination.  This is what my goal is.

Thanks
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
I believe that the difficulty is at the operating system level.  The assumption is that the source is already known, so it is not an argument.  There are no add-ons, or arguments that you can specify with IcmpSendEcho2 that will allow you to do that, that I know of.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.