mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Device: Add reconnect()
This commit is contained in:
committed by
Kyle Schwarz
parent
5d672d48d4
commit
b48160286b
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user