-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Using a buffer to send data to client #52
Comments
I found out that we have to define a size_t write(const uint8_t* data, size_t size) override {
if (client && isConnected()) {
return client.write(data, size);
} else {
return 0;
}
} Because the standard implementation in Print simply loops through all the characters and prints them one at a time: /* default implementation: may be overridden */
size_t Print::write(const uint8_t *buffer, size_t size)
{
size_t n = 0;
while(size--) {
n += write(*buffer++);
}
return n;
} Should I create a PR? |
Hey, Cheers |
Yes, on Esp32 it’s faster x5, on esp8266 х2 |
Cool! |
In fact, the speed gain depends on the length of the line to be printed. Most likely now there is 1 char/packet, and when using a buffer, N char/packet are sent. |
Hi,
Great library, thanks!
I noticed that data is sent to telnet one character at a time. This takes longer than if we sent 32 characters at a time, for example.
This sometimes triggers the watchdog.
Is it possible to use a buffer?
The text was updated successfully, but these errors were encountered: