-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[websocket] parser gets out of sync when data payload not received within timeout (IDFGH-13952) #680
Comments
Do you mean the parser that is called upon receiving esp-protocols/components/esp_websocket_client/include/esp_websocket_client.h Lines 79 to 80 in fbd296f
|
It's possible I was mistaken. I was also working on updating to v5.1.4(without #679 fix) that day, and this may have been #679 again. But I'm not certain it was. Separately, we might expand the transport_ws logging to include the error codes on failure, as I have done in my sandbox. Edit: I'm pretty sure this is a real bug, separate from #679, as the printout includes logging the esp-error I had only added with my fix.
That's what I would expect to happen. What I am afraid happened is:
|
If we get |
Sounds good to me, I would like to mention that if a client would prefers to read data more often than Thank you for taking a look at this. |
Answers checklist.
General issue report
When reading websocket transport payload data, if the payload data is not received within the read timeout, partial data is pulled from the stream, but the remaining payload data is never pulled from the stream, so the stream parser is then offset. The next time we try to read a message, it parses garbage because the data is misaligned. In this example, the websocket timeout is set to 25 seconds. WiFi router throttles to 5mbps download, 2mbps upload, 20% packet loss.
Often the stream eventually closes itself, but rarely a message fragment is received as valid JSON.
The text was updated successfully, but these errors were encountered: