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

Clean up QNetworkConnectionMonitor in QHttpNetworkConnection

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.9
    • Network
    • None
    • Foundation PM Staging

    Description

      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.

       

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes