Article View: borland.public.cppbuilder.internet.web
Article #1529Re: indy ping exmaple
From: Remy Lebeau (TeamB)
Date: Thu, 02 Dec 2004 17:54
Date: Thu, 02 Dec 2004 17:54
51 lines
2471 bytes
2471 bytes
"John M." <johnnym@yahoo.com> wrote in message
news:41af0a1b@newsgroups.borland.com...
> i tried this here:
That code is wrong. Did you not read Indy's documentation yet?
> IdIcmpClient1->Host = "www.borland.com";
You do not use the Host property. You pass the hostname to Ping() as a
parameter instead:
IdIcmpClient1->Ping("www.borland.com");
> ShowMessage(IdIcmpClient1->ReplyStatus);
ReplyStatus is a class, not a string:
switch( IdIcmpClient1->ReplyStatus->ReplyStatusType )
{
case rsEcho:
{
AnsiString s = "Reply from " +
IdIcmpClient1->ReplyStatus->FromIpAddress
+ (": bytes=" +
AnsiString(IdIcmpClient1->ReplyStatus->BytesReceived))
+ (" time=" +
AnsiString(IdIcmpClient1->ReplyStatus->MsRoundTripTime) + "ms")
+ (" TTL=" +
AnsiString(IdIcmpClient1->ReplyStatus->TimeToLive));
ShowMessage(s);
break;
}
case rsError:
ShowMessage("Request Error");
break;
case rsTimeOut:
ShowMessage("Request Timed Out");
break;
case rsErrorUnreachable:
ShowMessage("Host Unreachable");
break;
case rsErrorTTLExceeded
ShowMessage("TTL Exceeded");
break;
}
Gambit
Technical Details
Message-ID:
<41af5738$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!newsfeed.bit.nl!newsfeed.bit.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<41ae5b3a@newsgroups.borland.com> <41ae71eb@newsgroups.borland.com> <41af0a1b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,fa101c2ed92ef067 X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.web References: <41ae5b3a@newsgroups.borland.com> <41ae71eb@newsgroups.borland.com> <41af0a1b@newsgroups.borland.com> Subject: Re: indy ping exmaple Date: Thu, 2 Dec 2004 09:54:32 -0800 Lines: 53 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <41af5738$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1102010168 68.69.17.41 (2 Dec 2004 09:56:08 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!newsfeed.bit.nl!newsfeed.bit.nl!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail