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

QNetworkAccessManager cancels all requests after switching WiFi off/on

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.4
    • 5.7.1, 5.8.0 RC
    • Network
    • None
    • (macOS 10.12.2 / iOS 10.2 (different iOS versions also)), Xcode 8.2.1, Qt 5.7.1 / 5.8 RC

    Description

      I have problems with QNetworkAccessManager on both macOS and iOS.
      After disabling network access (i.e. turning wifi off) and re-enabling it after some time (20-30 seconds) the QNetworkAccessManager will not get network access at all.

      It happens quite often if the time when the network access is really down is longer.

      I think the problem itself might be in QNetworkConfigurationManager, as sometimes during turning wifi off I see log
      QObject::disconnect: Unexpected null parameter and shortly after that all request will fail, even if "the real access" is back.

      I think it's serious bug, as the only working workaround someone told me is to recreate QNetworkConfigurationManager instance(s) - I can do it for my own instances, but what about QML ones? I know about QDeclarativeNetworkAccessManagerFactory, but I don;t think there's a way to force re-creating all QML QNetworkConfigurationManager instances.

      EDIT:
      I've added minimal example project and example output (app was started with WIFI off).

      EDIT2:
      I found a workaround - in such case calling setNetworkAccessible(QNetworkAccessManager::Accessible); brings QNAM back to living world.

      Attachments

        Issue Links

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

          Activity

            People

              tpochep Timur Pocheptsov
              maciejweglarczyk Maciej Węglarczyk
              Votes:
              3 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes