开发者

Debugging missed broadcast datagrams, which show up in wireshark, but not in C# app?

开发者 https://www.devze.com 2023-04-06 21:06 出处:网络
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 thos

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 int开发者_开发百科ermittent, 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号