什么是PING -W参数的最大值?

发布于 2025-02-04 14:22:51 字数 161 浏览 4 评论 0原文

在我的计算机中,我运行命令ping 127.0.0.1 -c3 -w 5,结果还可以。代码>,结果不正确,结果是

ping:不良持续时间。

因此,我想知道ping -w参数的最大值是什么?

In my computer,I run the command ping 127.0.0.1 -c3 -W 5 and the result is ok.But when I run the command ping 127.0.0.1 -c3 -W 5000,the result is not ok,the result is

ping: bad linger time.

.So I wonder What's the max value for Ping -W parameter?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

指尖上得阳光 2025-02-11 14:22:51

关于您发布的版本,我只是查找代码 on Github S20160308

427

if (lingertime < 0 || lingertime > INT_MAX/1000000)

在您的特定情况下的最大值是int_max/1000000。现在int_max也可以取决于实现,但是保留默认值应为 2147483647 ,这将导致PING的答案-W最大值的最大值

2.147

但是,在较新版本的ping中,此值要高得多。
因此,您可以考虑更新iputils

Regarding your posted version i simply looked up the code on github for release s20160308.

as seen in line 427

if (lingertime < 0 || lingertime > INT_MAX/1000000)

the max value in your specific case is INT_MAX/1000000. Now INT_MAX can also depending on the implementation, but keeping the defaults it should be 2147483647 which would result in the answer of ping -W maximum value of

2.147

however in newer version of ping, this value is much higher.
so you might consider updating your iputils

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文