Having an interesting problem with TPing, and the replies under certain circumstances

Here is my code I'm using:

  Ping1.Address := '10.110.12.1';
  Memo1.Lines.Add(IntToStr(Ping1.Ping));
  Memo1.Lines.Add(IntToStr(Ping1.ErrorCode));
  Memo1.Lines.Add(IntToStr(Ping1.Reply.RTT));

If the address 10.110.12.1 Responds, I see the results 1, 0 and then the ms of the reply in my Memo1 - this is good.

If the address 10.110.12.1 Does not respond, (DOS PING shows "Request timed out") I see the results 0, 11010 and 0 in Memo1 - this is also good.

If however you are trying to ping a device on the local subnet which is not there (DOS PING shows "Destination host unreachable.") , the application returns 1, 0 and then the Reply.RTT shows the correct time it took to fail. It seems to me that this is a bug because the flag returned from ping indicates a success, and the ErrorCode also indicates no errors.

Windows 7 SP1 64 bit
Delphi XE2 Update 4
ICS BetaV8 Rev 991
VCL Forms Application
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to