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. Check Server Stats (online/offline)
Forum Updated to NodeBB v4.3 + New Features

Check Server Stats (online/offline)

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 4.4k 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.
  • A Offline
    A Offline
    azr79
    wrote on last edited by
    #1

    Hey everyone,
    So my deal is pretty simple (or maybe not), I just wanted to know, how can I check the status of a server/domain (offline/online) with QtNetwork.

    For example I want to check if "google.com" is online, how do I do to check his stats, pinging it? or is there any other solutions, preferably using QtNetwork

    PS - I never used QtNetwork before.

    Azr79

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

      All it depends on your definition of "online". If it's "it responds to an ICMP ping", then you can't do that with QtNetwork (but you can simply invoke the ping utility on your system by using QProcess). If it is "it responds to HTTP on port 80" you can try to issue a HEAD request using QNetworkAccessManager.

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • A Offline
        A Offline
        azr79
        wrote on last edited by
        #3

        I see, I already tried several things with accessmanager, but didn't work, still, I dind't tried HEAD request yet, can you explain me in detais how it could be used?

        Azr79

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          "QNetworkAccessManager::head() ":http://doc.qt.nokia.com/4.7/qnetworkaccessmanager.html#head is your friend. Use it just like a get request.

          http://www.catb.org/~esr/faqs/smart-questions.html

          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