Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to get speed network interface

How to get speed network interface

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 661 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • blackout69B Offline
    blackout69B Offline
    blackout69
    wrote on last edited by blackout69
    #1

    Hi,
    how to get the connection speed of a given network interface?
    My code is:

      foreach (const QNetworkInterface &interface, QNetworkInterface::allInterfaces())
        {
          QNetworkInterface::InterfaceFlags flags = interface.flags();
          if ((flags & QNetworkInterface::IsRunning) && !(flags & QNetworkInterface::IsLoopBack))
            {
              foreach (const QNetworkAddressEntry &address, interface.addressEntries())
                {
                  if (address.ip().protocol() == QAbstractSocket::IPv4Protocol)
                    {
                      qDebug() << interface.humanReadableName();    // Nome Interfaccia
                      qDebug() << address.ip().toString();          // IP Address
                      qDebug() << address.netmask().toString();     // Subnet Address
                      qDebug() << interface.hardwareAddress();      // MAC Address
                      qDebug() << ................................. // Speed Network
                    }
                }
            }
        }
    

    Thank you
    blackout69

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you mean getting whether it's in 10/100/1000Mb link state ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • blackout69B Offline
        blackout69B Offline
        blackout69
        wrote on last edited by
        #3

        @sgaist said in How to get speed network interface:

        Do you mean getting whether it's in 10/100/1000Mb link state

        Yes.
        blackout69

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fa_2
          wrote on last edited by
          #4

          Does anyone have a solution ?

          Christian EhrlicherC 1 Reply Last reply
          0
          • F fa_2

            Does anyone have a solution ?

            Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @fa_2 said in How to get speed network interface:

            Does anyone have a solution ?

            No, Qt has no option for this. You have to go low-level by yourself.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved