有时会通过TCP接收移位的数据

发布于 2025-02-09 08:23:11 字数 195 浏览 0 评论 0原文

我正在收到内容的包裹,其中内容不是在缓冲区的开始时,而是在Buffer的Byte 2或3处开始。有时会发生这种情况。这意味着接收到的数据都已移动。

我将缓冲区大小设置为4096字节。我正在使用Python插座的RECV方法,并正在从Siemens PLC接收数据(如果这是可能的问题来源)。

我是否错过了某些内容,或者有错误在我的程序中的某个地方?

I'm receiving packages where the content has its start not at the beggining of the buffer but at byte 2 or 3 of the buffer. That just happens sometimes. That means the received data are all shifted then.

I set the buffer size to 4096 bytes. I'm using the recv method from the Python sockets and am receving data from a Siemens PLC (if that's a possible source of issues).

Am I missing something out or has the error to be somewhere else than in my program?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文