Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.2.0 Beta3
-
None
Description
While looking at one of the old QtPositioning bugs (specifically https://bugreports.qt.io/browse/QTBUG-59826) I ended up in QBluetoothSocket sources, and I suspect that there might be some inconsistency and some implementations may report bytesAvailable() > 0 even for a closed socket.
The bytesAvailable() implementation is:
return QIODevice::bytesAvailable() + d->bytesAvailable();
And d->bytesAvailable() might not be cleared properly. At least I suspect that it happens for BlueZ implementation.
Same may be valid for canReadLine() call.
P.S.: I do not have any possibility to test the behavior on a real device, so this task is just based on reading the source code, and I might be missing something