gpt4 book ai didi

c - Windows平台下如何用C语言实现ping请求?

转载 作者:太空宇宙 更新时间:2023-11-03 23:36:43 25 4
gpt4 key购买 nike

我想用C语言实现ping请求。我在 Windows 平台上工作。任何人都可以建议如何实现它,或者如果代码已经可用,那么我可以从哪里找到它?

最佳答案

非常有用且开源 - fping .

fping is a ping(1) like program which uses the Internet Control Message Protocol (ICMP) echo request to determine if a host is up. fping is different from ping in that you can specify any number of hosts on the command line, or specify a file containing the lists of hosts to ping. Instead of trying one host until it timeouts or replies, fping will send out a ping packet and move on to the next host in a round-robin fashion. If a host replies, it is noted and removed from the list of hosts to check. If a host does not respond within a certain time limit and/or retry limit it will be considered unreachable.

Unlike ping, fping is meant to be used in scripts and its output is easy to parse.

关于c - Windows平台下如何用C语言实现ping请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/743647/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com