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

QNetworkInterface::allInterfaces freeze

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.3
    • Network
    • None
    • iMac 21.5" (Mid-2017) macOS 13.4.1
      MacBook Air 13" (2015/2017) macOS 12.7.2
    • macOS, Windows

    Description

      Description:
      Sometimes QNetworkInterface::allInterfaces freeze, for macOS it can take 20 seconds

      Logs message:
      get interfaces freeze elapsed = 20465 milliseconds

      Code:

      struct TimeoutLogger
      {
          explicit TimeoutLogger(qint64 timeoutMs = 500)
              : timer(timeoutMs)
          {
          }    
          
          ~TimeoutLogger()
          {
              if (timer.hasExpired()) {
                  const auto elapsed = timeoutMs + (QDeadlineTimer::current().deadline() - timer.deadline());           
                  qDebug() << "get interfaces freeze, elapsed = " << elapsed << " milliseconds");
              }
          }
          QDeadlineTimer timer;
      };
      
      const auto interfaces = []() {
         TimeoutLogger logger;
         return QNetworkInterface::allInterfaces();
      }();

       

      Attachments

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

        Activity

          People

            manordheim Mårten Nordheim
            evgenpervenenko Evgen Pervenenko
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes