Device: Add reconnect()

This commit is contained in:
Yasser Yassine
2025-10-11 16:33:22 -04:00
committed by Kyle Schwarz
parent 5d672d48d4
commit b48160286b
19 changed files with 118 additions and 54 deletions
+5 -1
View File
@@ -71,8 +71,12 @@ bool Driver::write(const std::vector<uint8_t>& bytes) {
if(writeBlocks) {
if(writeQueueFull()) {
while(writeQueueAlmostFull()) // Wait until we have some decent amount of space
while(writeQueueAlmostFull() && !isDisconnected() && !isClosing()) // Wait until we have some decent amount of space
std::this_thread::sleep_for(std::chrono::milliseconds(10));
if(isDisconnected() || isClosing()) {
return false;
}
}
} else {
if(writeQueueFull()) {