Recent

Author Topic: IdIcmpClient1 error  (Read 1614 times)

sadikacar60

  • New Member
  • *
  • Posts: 15
IdIcmpClient1 error
« on: October 31, 2021, 07:22:59 am »
The code that works without error in delphi 7 may cause an error in lazarus.
thanks

Code: Pascal  [Select][+][-]
  1.   IdIcmpClient1.Host:= '127.0.0.1';
  2. idICMPClient1.Ping();
  3. Memo1.Lines.Add('Bytes received: ' +
  4. IntToStr(idICMPClient1.ReplyStatus.BytesReceived));      
  5.  

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1043
    • Lebeau Software
Re: IdIcmpClient1 error
« Reply #1 on: November 01, 2021, 07:08:46 pm »
The code that works without error in delphi 7 may cause an error in lazarus.

Can you be more specific?  What is the actual error?  Is it a compile-time error, or a run-time error?

If run-time, then is your app running with admin rights?  TIdICMPClient uses a RAW socket to implement ICMP manually, and using a RAW socket requires admin rights on most modern platforms.

Which version of Indy are you using in Lazarus?  Delphi 7 is VERY OLD, which version of Indy were you using in it at the time? Were you using the version that came bundled with it?  If so, that would be a VERY OLD version of Indy, a LOT has changed in Indy over the years.

However, the code you have shown should work in the latest version of Indy.
« Last Edit: November 01, 2021, 07:15:47 pm by Remy Lebeau »
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

 

TinyPortal © 2005-2018