BeginSendTo 是否在消息前添加大小为 4 字节的整数前缀?

发布于 2024-10-08 04:50:25 字数 204 浏览 0 评论 0原文

我继承了一个项目,其中包含两个应用程序之间的对话框。一个使用本机 C++,另一个使用 VB.NET。该协议规定消息的前 4 个字节(32 位)对大小进行编码。然而,VB.NET 端从不设置前四个字节,但它使用 .net 方法 BeginSendTo,该方法接受大小参数。

所以我的问题是; BeginSendTo 方法是否自动以 4 字节 int 的形式将大小添加到消息的开头?

I inherited a project that includes a dialog between two applications. One in native C++ the other in VB.NET. The protocol is such that the first 4 bytes (32 bits) of the message encodes the size. However the VB.NET side never sets these first four bytes, however it does use the .net method BeginSendTo, which accepts an argument for size.

So my question is; Does the BeginSendTo method automatically add the size to the beginning of the message in the form of a 4 byte int?

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

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

发布评论

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

评论(1

演出会有结束 2024-10-15 04:50:25

不会。BeginSendTo() 方法的 size 参数指示实际发送的 buffer 参数的字节数。有关详细信息,请参阅MSDN 条目

No. The size argument to the BeginSendTo() method indicates how many bytes of the buffer argument to actually send. See the MSDN entry for details.

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