me-no-dev / ESPAsyncTCP

Async TCP Library for ESP8266
GNU Lesser General Public License v3.0
755 stars 392 forks source link

Sending Message to Client not Clearing Buffer #162

Closed ArtimusDingo closed 3 years ago

ArtimusDingo commented 3 years ago

I have modified the replytoServer demo as follows but it looks like the previous message is getting sent along with the new message. Is there a way to clear the buffer?

static void replyToServer(void arg) { char strvoltage = readVoltage(); AsyncClient client = reinterpret_cast<AsyncClient>(arg); if (client->space() > 32 && client->canSend()) { char message[32]; strcat(message, "stuff "); strcat(message, strvoltage); Serial.println(message); client->add(message, strlen(message)); client->send();

} }

stale[bot] commented 3 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.