Wenn man sich den Quellcode vom idcmp anschaut, scheint das so gewollt zu sein:
Delphi-Quellcode:
function TIdIcmpClient.Receive(ATimeOut: Integer): TReplyStatus;
var
BytesRead : Integer;
Size : Integer;
StartTime: Cardinal;
begin
FillChar(bufReceive, sizeOf(bufReceive),0);
Size := sizeof(bufReceive);
StartTime := GetTickCount;
repeat
BytesRead := ReceiveBuffer(bufReceive, Size, ATimeOut);
GStack.CheckForSocketError(BytesRead);
if DecodeResponse(BytesRead, Result) then
begin
break
end
else
begin
// The received reply wasn't for this request, so make sure we don't
// report it as such in case we time out after this
result.BytesReceived := 0;
result.FromIpAddress := '0.0.0.0'; {Do not Localize} {<----------------------------------------}
result.MsgType := 0;
result.SequenceId := wSeqNo;
result.TimeToLive := 0;
result.ReplyStatusType := rsTimeOut;
ATimeOut := Cardinal(ATimeOut) - GetTickDiff(StartTime,getTickCount); // compute new timeout value
end;
until ATimeOut <= 0;
end;
Grüße
Klaus