Thread View: borland.public.cppbuilder.internet.web
3 messages
3 total messages
Started by billaras
Wed, 16 Feb 2005 10:50
ping
Author: billaras
Date: Wed, 16 Feb 2005 10:50
Date: Wed, 16 Feb 2005 10:50
15 lines
1530 bytes
1530 bytes
(this question is also posted in students)
i would like to ping a client ,i tryed to use tIdIcmpClient ,the code i
wrote is..
void __fastcall TForm1::Button1Click(TObject *Sender)
{
IdIcmpClient1->Host=Edit1->Text;
IdIcmpClient1->Ping();
Memo1->Lines->Add(IdIcmpClient1->ReplyStatus.MsRoundTripTime);
}well when i execute the code many times fast i get a 0 value returned ,is
this normal?
also if i am behind a proxy server how can i declare which is the gateway
?beacause i can only ping the computers in my lan
network,noone in the internet...
Re: ping
Author: billaras
Date: Wed, 16 Feb 2005 11:23
Date: Wed, 16 Feb 2005 11:23
68 lines
3072 bytes
3072 bytes
i have tried to use the code provided above in a previous question the code
is following:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
IdIcmpClient1->Host=Edit1->Text;
AnsiString s;
IdIcmpClient1->Ping();
switch(IdIcmpClient1->ReplyStatus.ReplyStatusType)
{
case rsEcho:
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;
Memo1->Lines->Add(s);
}
}
the problem is that i receive a 0 value in time if i execute many times fast
and most important that the time i get is very big..
what i mean is..if i ping a computer in my lan a receive from dos a <1ms
time in my program a value around 16ms and withe the code above around
>36..its very strange indeed .is there any explaination?
� "billaras" <billaras1234@hotmail.com> ������ ��� ������
news:42132571@newsgroups.borland.com...
> (this question is also posted in students)
>
> i would like to ping a client ,i tryed to use tIdIcmpClient ,the code i
> wrote is..
> void __fastcall TForm1::Button1Click(TObject *Sender)
> {
> IdIcmpClient1->Host=Edit1->Text;
> IdIcmpClient1->Ping();
> Memo1->Lines->Add(IdIcmpClient1->ReplyStatus.MsRoundTripTime);
>
> }well when i execute the code many times fast i get a 0 value returned ,is
> this normal?
> also if i am behind a proxy server how can i declare which is the gateway
> ?beacause i can only ping the computers in my lan
> network,noone in the internet...
>
>
>
>
Re: ping
Author: Remy Lebeau (TeamB)
Date: Wed, 16 Feb 2005 18:19
Date: Wed, 16 Feb 2005 18:19
10 lines
1051 bytes
1051 bytes
"billaras" <billaras1234@hotmail.com> wrote in message news:42132571@newsgroups.borland.com... > (this question is also posted in students) Please do not cross-post. Only post to the single most appropriate group. Gambit
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads