Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Sep : Re: TIdIcmpClient TThread
| Subject: | Re: TIdIcmpClient TThread |
| Posted by: | "Tobias" (tobias_..@hotmail.com) |
| Date: | Sun, 17 Sep 2006 16:34:44 |
I find the error in procedure TIdCustomIcmpClient.InternalPing(const AIP,
ABuffer: String; SequenceID: word);
begin
if SequenceID <> 0 then
begin
wSeqNo := SequenceID;
end;
SetLength(FbufIcmp,FPacketSize); //raise EAV read of address 00000000.
if Self.FIPVersion = Id_IPv4 then
begin
SetLength(FbufReceive,FPacketSize+Id_IP_HSIZE);
end
else
begin
SetLength(FbufReceive,FPacketSize+(Id_IPv6_HSIZE*2));
end;
PrepareEchoRequest(ABuffer);
SendEchoRequest(AIP);
GetEchoReply;
Binding.CloseSocket;
DoReply(FReplyStatus);
Inc(wSeqNo); // SG 25/1/02: Only incread sequence number when finished.
end;
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> skrev i meddelandet
news:450b09f5$1@newsgroups.borland.com...
>
> "Tobias" <tobias__a@hotmail.com> wrote in message
> news:450ac361$1@newsgroups.borland.com...
>
>> thx i did a lite change to your code but it did not worke either.
>
> Why not?
>
>> ReplyStatus.Msg is protected
>
> Then you are using an old version. The ReplyStatus property was changed
> from protected to public awhile ago.
>
>> I get a EAccessViolation at Icmp.Ping.
>
> That is not very helpful. What EXACTLY does it say? Have you tried
> stepping through the code yet to find the error?
>
>> if Icmp.Receive(1000).Msg = 'Echo' then
>
> Do not call Receive() directly. Ping() does that internally. You are
> trying to read something that has already been read, so you are going to
> wipe out your results.
>
>
> Gambit