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

标签 c

我想用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/

相关文章:

c - 如何在不命名的情况下访问 union 成员?

c - C语言中如何初始化寄存器unsigned long

c - 在 C 中,如何访问指针数组(作为参数传递)

c - 如何通过函数指针实现栈以及如何使用

c++ - C/C++ iTunes API 在哪里? (不是 COM!)

C 打印 1-10,有问题

c - 是否有使用不带大括号的 switch 语句的有用案例?

c - const 说明符在 cast 中的必要性

C 中的注释部分和注释 block

c - 按降序输出数组的索引