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

Clean up QNetworkConnectionMonitor in QHttpNetworkConnection

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.9
    • Network
    • None

      Every QHttpNetworkConnection(Private) contains a QNetworkConnectionMonitor. It is supposed to alert the connection about changes in network connectivity:

       

      if (QNetworkConnectionMonitor::isEnabled()) {
          connect(&d->connectionMonitor, &QNetworkConnectionMonitor::reachabilityChanged,
                  this, &QHttpNetworkConnection::onlineStateChanged, Qt::QueuedConnection);
      } 

      and then finish the connection

      void QHttpNetworkConnection::onlineStateChanged(bool isOnline)
      {
          ...
      
          for (int i = 0; i < d->activeChannelCount; i++) {
              auto &channel = d->channels[i];
              channel.emitFinishedWithError(QNetworkReply::TemporaryNetworkFailureError, "Temporary network failure.");
              channel.close();
          }
          ...
      } 

      However, QNetworkConnectionMonitor is not enabled on all platforms. From an internal discussion it became clear that

      • it is using deprecated API on Mac/iOs (it was updated, I just don't have a great memory)
      • it is not very elegantly implemented on Windows because of missing OS APIs
      • it is not existing on Linux

      For the sake of a clean code we should revisit this class and port it away from deprecated APIs, find elegant solutions for all platforms or consider removing or replacing it alltogether.

      The scope of this ticket is to make a decision on whether this class should refurbished and implemented on all platforms, removed without replacement or replaced by something new.

       

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

            manordheim Mårten Nordheim
            matthias_rauter Matthias Rauter
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes