调试丢失的广播数据报,这些数据报显示在wireshark中,但不显示在C#应用程序中?

发布于 2024-12-06 00:20:25 字数 414 浏览 1 评论 0原文

我有两台机器 A1 和 A2,它们都运行相同的嵌入式代码,用于广播数据包。第三台机器 B3 是运行 C# (.NET 4.0) 应用程序的 Windows XP 机器,用于侦听这些广播。

来自 A1 的所有数据均按预期由 C# 接收,来自 A2 的 95% 的数据是通过间歇性、看似随机、丢失的 UDP 数据报接收的。

当我在 B3 上查看wireshark时,来自两台机器的所有数据包都完全按照预期到达,但是当我在收到字节后立即将字节转储到文本文件时,我发现来自B2的数据报丢失了。

为什么数据包显示在wireshark 上,但有时没有传递到我的C# 应用程序?我可以理解数据报是否有错误的标头等,但 Wireshark 按预期显示所有内容,即使对于这些缺失的标头也是如此。 Windows / .NET 是否执行 Wireshark 默认情况下不执行的某些检查?

I have two machines A1 and A2, both of which are running the same embedded code, which broadcast packets. The third machine, B3, is a Windows XP box running a C# (.NET 4.0) app, which listens for those broadcasts.

All of the data from A1 is received by the C# as expected, 95% of the data from A2 is received with intermittent, seemingly random, lost UDP datagrams.

When I look on wireshark on B3, all of the packets from both machines arrive exactly as expected, but when I dump the bytes to a text file immediately after receiving them, I see that datagrams from B2 are missing.

How can it be that a packet is displayed on wireshark, but does not get passed to my C# app, some of the time? I could understand if the datagram had bad headers, etc., but Wireshark shows everything as expected, even for these missing ones. Does Windows / .NET perform some check that Wireshark does not by default?

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

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

发布评论

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

评论(1

那小子欠揍 2024-12-13 00:20:25

我建议将 B2 流转储到文件中,然后直接将其重播到您的应用程序(如果可能,使用本地应用程序)。您应该受益于持续的数据流,以便(希望)缩小有问题的部分。

I would recommend dumping the B2 stream into a file, and then replaying it directly to your app (using a local app, if possible). You should benefit from having a constant data stream in order to (hopefully) narrow down the problematic part.

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