BeginSendTo 是否在消息前添加大小为 4 字节的整数前缀?
我继承了一个项目,其中包含两个应用程序之间的对话框。一个使用本机 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不会。
BeginSendTo()
方法的size
参数指示实际发送的buffer
参数的字节数。有关详细信息,请参阅MSDN 条目。No. The
size
argument to theBeginSendTo()
method indicates how many bytes of thebuffer
argument to actually send. See the MSDN entry for details.