Link to home
Start Free TrialLog in
Avatar of mphillip85
mphillip85Flag for United States of America

asked on

visual studio 2010 + getting ping latency from remote computer

I would like to get the ping information (latency) when I ping a remote computer.
Avatar of daveamour
daveamour
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mphillip85

ASKER

how do i make the source (127.0.0.1) different.  I want to test a ping from a changing source and destination.  
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
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
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.