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

Improve and expand mqtt websocket example.

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.11
    • Fix Version/s: None
    • Component/s: MQTT
    • Labels:
      None
    • Environment:

      Suse 42.3

      gcc v7.2.1

      Description

      The QMqttClient class defines enum TransportType { IODevice, AbstractSocket, SecureSocket }.

      For a QIODevice, the QMqttClient will check to see if the 'transport' isOpen() and when not, QIODevice->open() will be called.
      Immediately after that, MqttClient will send the mqtt credentials via sendControlConnect().

      The WebSockets MQTT Subscription example internally uses a WebSocketIODevice class that is a QIODevice and has a QWebSocket. The open() method will open the QWebSocket and send out a QNetworkRequest to setup the websocket. The open() call will return immediately, but the QWebSocket will not be usable until the socket is actually connected, which then triggers QMqttClient to send the credentials.

      When the example code is based on QIODevice, the code should probably reflect / emphasize that the device setup should be finished before providing it to the QMqttClient.

      See also QTBUG-66955

        Attachments

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

          Activity

            People

            Assignee:
            mkalinow Maurice Kalinowski
            Reporter:
            mr.gadgets Frank van Vugt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes