what would cause ICMPsendEcho to fail when ping.exe succeeds

我的梦境 提交于 2019-12-03 12:43:01

The answer might be in the size of the ping you send (there seems to be an undocumented minimum size of 20 bytes for the payload). See this post for more info: http://groups.google.com/group/microsoft.public.win32.programmer.networks/browse_thread/thread/2b28b994a8067713?pli=1

Have you checked the user permissions? Ping.exe does not require administrator rights, but the raw ICMP commands in Windows need administrator privileges.

See this example: http://www.delphi-central.com/tutorials/icmp-ping.aspx

Please note, however, that for Windows NT and Windows 2000 implementations, Raw Sockets are subject to security checks and are accessible only to members of the administrator's group.


Another possible reason could be a firewall which blocks ICMP packets.

We had the same error with a client. The solution was to implement IcmpSendEcho2 as a plan B when IcmpSendEcho fails. It worked!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!