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

www.cryer.info
Managed Newsgroup Archive

Re: Delphi Indy 10 TIdIcmpClient

Subject:Re: Delphi Indy 10 TIdIcmpClient
Posted by:"Don Siders" (sider..@att.net)
Date:Sat, 23 Dec 2006 15:03:55

>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

I'm not sure if this satifsfies all your processing requirements. The
changes in how TIdICMPClient handles ping responses were related to two
areas:

* multi-threaded pings
* packet differences between ECHO replies and TTL errors

You'll could use the TIdICMPClient.OnReply event handler to access TTL
information received in the reponse packets.

It would be easier to use the TIdTraceRoute component
(.\Core\IdTraceRoute.pas).  It already handles the packet sequencing issues,
as well as Host IP to Host Name resolution.  Check out the Trace and DoReply
methods in that unit.

hth...

---

> 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:

In response to:

www.cryer.info
Managed Newsgroup Archive