Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Dec : Delphi Indy 10 TIdIcmpClient

www.cryer.info
Managed Newsgroup Archive

Delphi Indy 10 TIdIcmpClient

Subject:Delphi Indy 10 TIdIcmpClient
Posted by:val..@dk.is
Date:Sat, 23 Dec 2006 13:52:06

I really need help with this one......
Changes made in indy 10 seem not to include TTL
witch a really need to solve my problem,
or if some one out there knows of a better way to resolve this then
please be jolly over ther holliday and help me :)

Here is a sample of my code like i would think this should work on
earlier versions of indy


function GetIspIP(const HostToTrace : String) : String;
var
   ICMP: TIdIcmpClient;
   i : Integer;
begin
   result := '';
   ICMP := TIdIcmpClient.Create;
   ICMP.ReceiveTimeout := 1000;
   ICMP.Host := HostToTrace; // for example google.com
   // the route should first return my ip then router the the isp witch
whould have a dns name
   // and i would like to use that dns name
   for I := 1 to 20 - 1 do
   begin
     ICMP.TTL := ICMP.TTL;
     ICMP.Ping;
     // check if FromIpAddress includes domin.??(?) , not only ip
address
     if HasDnsIncluded(ICMP.ReplyStatus.FromIpAdress) then
     begin
                     //Extract Domin name
        result := ExtractDns(ICMP.ReplyStatus.FromIpAdress);
        exit;
     end;
   end;
end;

Replies:

www.cryer.info
Managed Newsgroup Archive