There are two private QBluetoothSocket backends on Linux:
- QBluetoothSocketBluez is native linux socket implementation
It is always used by the linux QBluetoothServer, and by
QBluetoothSocket if Bluez version is < 5.46
- QBluetoothSocketBluezDbus used by QBluetoothSocket when
Bluez >= 5.46
Leaving the native socket unclosed leaks the resource and eventually
we may run out of descriptors. This is reproducible by creating and
destroying QBluetoothServer instances in a loop.
As a related drive-by:
- Fix bluetooth socket autotest version check. DBus socket is used
with bluez 5.46+ (for clarity: DBus lowenergycontroller
is used with bluez 5.42+). This is needed for the test to pass
with Bluez < 5.46
- Add a clarifying comment on socket close()
Fixes: QTBUG-103067
Change-Id: Idc38c743be09e559ea82bf09c2f9e44e4b80d666
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| README.txt | ||
| qbluetoothsocket.pro | ||
| tst_qbluetoothsocket.cpp | ||
README.txt
This test requires bttestui running on a remote machine, and for it to be discoverable and connectable to the device under test. The bttestui should run an rfcomm server (see UI option SListenUuid). bttestui is available in tests/bttestui. The unit test attempts to use service discovery to locate bttestui.