Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63630

QBluetoothSocket on OS X doesn't connect when associated with other than main QThread

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Invalid
    • Affects Version/s: 5.6.2, 5.7.1, 5.9.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Reproduced on Mac OS 10.7 and 10.10 and 10.11

      QtCreator 3.4 and 3.6 on Xcode SDK 4.x and 7.x

      Reproduced with Qt 5.6.2, 5.7.1 and 5.9.1

      Doesn't occur on Linux
    • Platform/s:
      macOS

      Description

      See attached BugDemo.cpp.

      If connectToService is run in the main thread and QBluetoothSocket is associated with the main thread everything works as specified.

      If QBluetoothSocket is moved to a separate thread with its own event loop a connect never happens; none of the signals is ever emitted.

      This issue only appears on OS X (all tested versions); on Linux everything works fine regardless of the thread affinity of QBluetooth socket.

      A similar effect can be achieved when running IOBluetoothRFCOMMChannel or its delegate without an event loop. I therefore conclude that for some reasons the QThread based event loop is not sufficient to run IOBluetoothRFCOMMChannel (which is somewhere burried deep inside the QBluetoothSocket machinery).

        Attachments

        For Gerrit Dashboard: QTBUG-63630
        # Subject Branch Project Status CR V

          Activity

            People

            • Assignee:
              tpochep Timur Pocheptsov
              Reporter:
              r.k. Rochus Keller
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes