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

Client-Message-Buffer #154

Open
Knabbler opened this issue May 1, 2024 · 0 comments
Open

Client-Message-Buffer #154

Knabbler opened this issue May 1, 2024 · 0 comments
Assignees

Comments

@Knabbler
Copy link

Knabbler commented May 1, 2024

/*

  1. Task: ESP32, Websocket-Client, receive and process 48,000 Bytes of Data

  2. The library could not handle such long messages.
    Workaround:

    • Server splits the data into four pieces.
    • Client collects the 4 portions
  3. Issue
    After code line with "SEND_3" the message will be corrupted.
    It seems that "readBlocking()" does not free the message buffer.
    Workaround:

    • client.connect() .. message 1 .. client.close()
    • client.connect() .. message 2 .. client.close()
    • client.connect() .. message 3 .. client.close()
    • client.connect() .. message 4 .. client.close()
  4. Any suggestions for a cleverer solution?
    */

client.connect(server_address);
if (client.available())
{
client.send("SEND_1"); // Server will send first 12,000 Bytes
auto message = client.readBlocking();
// do something with the message

client.send("SEND_2");  // Server will send second 12,000 Bytes
auto message = client.readBlocking();
// do something with the message

client.send("SEND_3");  // Server will send third 12,000 Bytes
auto message = client.readBlocking();
// do something with the message

client.send("SEND_4");  // Server will last 12,000 Bytes
auto message = client.readBlocking();
// do something with the message

}

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

2 participants