You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the documentation needs a warning that this method may cause loss of data.
I haven't confirmed all of the details, but I think the different driver implementations of flush() may not be consistent.
In my specific case, write() followed by flushIOBuffers() occasionally caused data loss. I think its a race condition where write() returned without error, but the OS driver has not yet begun transmitting, or is maybe in the process of transmitting. Instead of flush() waiting for buffer to empty, it simply clears the buffer. My understanding is that flush signals the driver to begin transmitting (ignore timeout), then blocks until buffer is empty. Of course my understanding could be wrong on this.
My receiving device is an ESP32-S3 CDC serial.
The text was updated successfully, but these errors were encountered:
I think the documentation needs a warning that this method may cause loss of data.
I haven't confirmed all of the details, but I think the different driver implementations of flush() may not be consistent.
In my specific case, write() followed by flushIOBuffers() occasionally caused data loss. I think its a race condition where write() returned without error, but the OS driver has not yet begun transmitting, or is maybe in the process of transmitting. Instead of flush() waiting for buffer to empty, it simply clears the buffer. My understanding is that flush signals the driver to begin transmitting (ignore timeout), then blocks until buffer is empty. Of course my understanding could be wrong on this.
My receiving device is an ESP32-S3 CDC serial.
The text was updated successfully, but these errors were encountered: