Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TidIcmpClient.Ping emulation
#1
Seasonal greetings to y'all;
When I go to DOS prompt (a.k.a. Command Prompt) and run ping like this

Code:
C:\Users\Boba> ping -4 10.76.201.171
the reply comes back OK:

Code:
Pinging 10.76.201.171 with 32 bytes of data
Reply from 10.76.201.171: bytes=32 time=137 TTL=105
...
Ping statistics for 10.76.201.171:
...
but with Indy.10's TidIcmpClient:

Code:
TidIcmpClient *pIcmpClient;
...
pIcmpClient->Host = "10.76.201.171";
pIcmpClient->RecieveTimeout = 4000;
pIcmpClient->Ping();
About 4 seconds later I get 0[zero] (TReplyStatusTypes::rsTimeOut).
What do I miss to mimic the DOS ping behaviour? TIA
Reply
#2
(10-30-2023, 03:23 AM)Boba TC Wrote: About 4 seconds later I get 0[zero] (TReplyStatusTypes::rsTimeOut).
What do I miss to mimic the DOS ping behaviour? TIA

On the 1st Sight i would say your App is blocked by a System-Firewall (Windows Systems) or your Router.

Greetings
Reply
#3
(10-30-2023, 03:23 AM)Boba TC Wrote: About 4 seconds later I get 0[zero] (TReplyStatusTypes::rsTimeOut).

Did you verify with a packet sniffer, like Wireshark, that your ping request is actually being transmitted out to the network, and is being responded to?

Also, make sure you are running your code as an elevated user. TIdIcmpClient uses a RAW socket, which requires admin rights. The command-line ping does not require that.

Reply
#4
(10-30-2023, 05:26 PM)rlebeau Wrote:
(10-30-2023, 03:23 AM)Boba TC Wrote: About 4 seconds later I get 0[zero] (TReplyStatusTypes::rsTimeOut).

Did you verify with a packet sniffer, like Wireshark, that your ping request is actually being transmitted out to the network, and is being responded to?

Also, make sure you are running your code as an elevated user.  TIdIcmpClient uses a RAW socket, which requires admin rights.  The command-line ping does not require that.

Thank you, Remy, for the prompt reply. When I use a different target IP (f.i. 144.160.36.42 or 142.250.105.101 ) I get echo reply with params identical to those returned by the DOS ping. My RG does not block any of my outgoing packets. I suspect the OS does something different (I'll have to install the WireShark). Will keep posted.

(10-30-2023, 03:15 PM)fearcry Wrote:
(10-30-2023, 03:23 AM)Boba TC Wrote: About 4 seconds later I get 0[zero] (TReplyStatusTypes::rsTimeOut).
What do I miss to mimic the DOS ping behaviour? TIA

On the 1st Sight i would say your App is blocked by a System-Firewall (Windows Systems) or your Router.

Greetings

hi fearcry; I can't blame either firewall or my RG (see me reply to Remy). What else should I look at?
Reply
#5
(10-31-2023, 05:08 AM)Boba TC Wrote: My RG does not block any of my outgoing packets.

What is an "RG"?

Reply
#6
(10-31-2023, 05:08 AM)Boba TC Wrote: hi fearcry; I can't blame either firewall or my RG (see me reply to Remy). What else should I look at?

because icmp is blocked by default on windows-systems for a longer time, thats why i wrote "on the 1st sight".

More Info:
Create an Inbound ICMP Rule

Remy is right, your app "must" be allowed to pass the firewall, microsoft's dos cmd don't need special rules for that.

cheers
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)