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

QNetworkInformation doesn't update state on MacOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • None
    • 6.5.3
    • Network
    • None
    • MacOS 15.1 (24B83)
      Qt 6.5.3
    • macOS
    • 8
    • Foundation Sprint 121, Foundation Sprint 122, Foundation Sprint 123

    Description

      `QNetworkInformation` doesn't update it's properties after initialisation on MacOS. It provides valid statuses until network state doesn't change since backend has been loaded. If you load the backend, then disconnect from network - it will still report reachability as connected. It's happening for reachability and transport medium. Most probably for rest of properties as well. Works fine on Windows.

      Code to reproduce:

      1. Initialise backend by feature beforehand.

       

      QNetworkInformation::loadBackendByFeatures(QNetworkInformation::Feature::Reachability);

      2. Get reachability state.

      const auto* info = QNetworkInformation::instance();
      if (info && info->supports(QNetworkInformation::Feature::Reachability))
      {        
          const auto status = info->reachability();
          // status is valid for the initial state when backend has been created. Any further change in network availability is not propagated to QNetworkInformation
      }

       

       

      Attachments

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

        Activity

          People

            marcinlisowski Marcin Lisowski
            marcinlisowski Marcin Lisowski
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes