Skip to content
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 not able to receive all the chunk of the data and getting parts when receiving (IDFGH-11691) #458

Closed
3 tasks done
Pavan-keus opened this issue Dec 14, 2023 · 4 comments
Assignees

Comments

@Pavan-keus
Copy link

Answers checklist.

  • I have read the documentation for esp-protocols components and the issue is not addressed there.
  • I have updated my esp-protocols branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

image
in the above image u can see that i receive 1436 bytes and after 7 bytes but it should be 1443 why it got fragmented ? any idea and my configuration for websocket is
k_keusWebsocket_webSocketConfig_g.host = CONFIG_KEUS_WEB_SOCKET_HOST;
k_keusWebsocket_webSocketConfig_g.port = CONFIG_KEUS_WEB_SOCKET_PORT;
k_keusWebsocket_webSocketConfig_g.buffer_size = 8192;
k_keusWebsocket_webSocketConfig_g.task_prio = 10;
ESP_LOGI(TAG, "Connecting to Websocket ...");

K_keusWebsocket_webSocketClient_g = esp_websocket_client_init(&k_keusWebsocket_webSocketConfig_g);

esp_websocket_client_start(K_keusWebsocket_webSocketClient_g);

@github-actions github-actions bot changed the title websocket not able to receive all the chunk of the data and getting parts when receiving websocket not able to receive all the chunk of the data and getting parts when receiving (IDFGH-11691) Dec 14, 2023
@gabsuren
Copy link
Contributor

@Pavan-keus the issue has been fixed in the latest master of esp-protocols.
Could you please retry and see if you face it again?

Thanks you
Suren

@joelguittet
Copy link

Hello @gabsuren @Pavan-keus

I have the exact same issue. Using the latest release websocket 1.2.3.

@gabsuren I browsed the history of websocket code and I don't see any recent (2023-2024) commits related to a fix for this problem. Can you elaborate on this "the issue has been fixed in the latest master" please ??

@Pavan-keus on your side is it fixed ? Just by updating the websocket client or maybe you have done other modifications on your application ?

Thanks for the feedbacks!
Joel

@david-cermak
Copy link
Collaborator

Hi @joelguittet

Do you receive your data in chunks? Did you check the values of payload_len and payload_offset variables of esp_websocket_event_data_t on getting an WEBSOCKET_EVENT_DATA event?


Can you elaborate on this "the issue has been fixed in the latest master" please ??

I think that Suren mistaken this issue with another one (related to fragmentation of a connect message). the websocket client doesn't decompose fragmented data, so if they arrive in pieces they are passed like that in multiple events.

@joelguittet
Copy link

@david-cermak good point! I just checked the payload length and offset values adding a log. This is exactly my issue. I need to concatenate the data before sending this to the upper layer.
Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants