我使用的是 Windows 10。我的 wifi 网络每 10 秒就会出现一次高 ping 值。例如,我正在 ping 我的路由器:
ping 192.168.10.1 -t
Reply from 192.168.10.1: bytes=32 time=1215ms TTL=64
Reply from 192.168.10.1: bytes=32 time=9ms TTL=64
Reply from 192.168.10.1: bytes=32 time=2ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=2ms TTL=64
Reply from 192.168.10.1: bytes=32 time=2ms TTL=64
Reply from 192.168.10.1: bytes=32 time=2ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=1036ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=2ms TTL=64
Reply from 192.168.10.1: bytes=32 time=2ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=5ms TTL=64
Reply from 192.168.10.1: bytes=32 time=2ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=763ms TTL=64
Reply from 192.168.10.1: bytes=32 time=2ms TTL=64
Reply from 192.168.10.1: bytes=32 time=4ms TTL=64
Reply from 192.168.10.1: bytes=32 time=2ms TTL=64
Reply from 192.168.10.1: bytes=32 time=2ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=2ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=3ms TTL=64
Reply from 192.168.10.1: bytes=32 time=581ms TTL=64
为什么会发生这种情况?
答案1
这是因为我曾经使用过一款名为 LightScreen 的截图应用。它使用了一个名为 Qt 的库,而这个库的网络管理器有一个 bug,它会每 10 秒进行一次 wifi 网络轮询,从而导致网络中断:
https://github.com/ckaiser/Lightscreen/blob/master/tools/uploader/uploader.cpp#L30
https://bugreports.qt.io/browse/QTBUG-40332
可以通过将环境变量设置QT_BEARER_POLL_TIMEOUT
为 -1 来解决这个问题。