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

QBluetoothServer::listen on an already registered port should set error to ServiceAlreadyRegisteredError

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P3: Somewhat important
    • 5.4.2
    • 5.3.2
    • None
    • Architecture armhf, Emdebian Wheezy, bluez 4.99, Qt 5.3.2

    Description

      When trying to listen on a port that is already registered, the behaviour of QBluetoothServer::listen on android and bluez differs as far as I can see from the source:
      Android: set lastError to ServiceAlreadyRegisteredError
      bluez: set lastError to InputOutputError

      https://qt.gitorious.org/qt/qtconnectivity/source/167faeec86ed4d9c9f099f5180784c7b0cb9aa42:src/bluetooth/qbluetoothserver_bluez.cpp#L164
      https://qt.gitorious.org/qt/qtconnectivity/source/167faeec86ed4d9c9f099f5180784c7b0cb9aa42:src/bluetooth/qbluetoothserver_android.cpp#L200

      When using bluez it's also possible to set lastError to ServiceAlreadyRegisteredError, since bind returns EADDRINUSE when the port is already in use.

      http://lxr.free-electrons.com/source/net/bluetooth/rfcomm/sock.c#L362

      I tested this with bluez 4.99 and it works fine.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ablasche Alex Blasche
            mbuijs Martijn Buijs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes