Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
hello every body

i m working on a project that's need to calculate the shortest i e . i need to check which machine is near to my system . so foe this i m using sockets. I m having a array list in which all the system ip address are listed . so i need to check which ip is near to my system. For that i m sending a test packet to each ip sequently n get the reply from that ip system . until i get reply i will not send another test packet to other system i.e i m taking synchronous reply.

So my problem is how can i calculate the time span in sending a packet n receiving a packet . this transmitting n receiving gets with in milliseconds . so how can i calculate the shortest path .



If u r having any other option so please share with me



From,
Arun
Posted

1 solution

use Ping and PingReply. The PingReply shows the RoundTripTime.
http://msdn.microsoft.com/en-us/library/system.net.networkinformation.pingreply.roundtriptime.aspx[^]
 
Share this answer
 
Comments
arunrv 26-Aug-11 4:22am    
ya it fine but i s giving RoundtripTime=0 . I have connected the systems in lan .but i want time delay . So any other options
Herman<T>.Instance 26-Aug-11 5:24am    
in that case you have to Ping with a hard set TTL. This is the basic TraceRoute command in effect. Start with 1 and stop till ipaddress matches the other computer. But even than you can find 100 computers on step 2 as first pc results

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900