Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我编写了一个 Android 应用程序,它使用 ProcessBuilder 在进程中启动 tcpdump。当我启动进程并轮询 InputStream 时,有时会发生第一个输出在 20-30 秒后写入 - 尽管数据包已被捕获。 我使用 tcpdump -l 所以输出是行缓冲的。 当我对进程(killall)进行一些重新启动时,它会立即响应新数据包。
有人有什么建议吗?网络堆栈上是否有任何必须首先清除的缓冲?
感谢您的任何建议!
也许尝试 tcpdump -n 所以它不会尝试将 ip 解析为主机名?
在重新运行时,查找可能会在本地缓存,因此运行速度更快。