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. QNetworkAccessManager in/out data counter
Forum Updated to NodeBB v4.3 + New Features

QNetworkAccessManager in/out data counter

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 2.9k 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
    A.A.M.
    wrote on last edited by
    #1

    Hi all!
    Is there any way to count in/out data size (up to a byte) which was transmitted trough QNetworkAccessManager?
    Without using 3rd-party proxy server or something similar.
    Thanks.

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      You could do this using a QNAM proxy possibly coupled with a custom QNetworkReply. Take a look at this "blog entry":http://blogs.kde.org/node/4210 and the next couple by Rich Moore to get an idea of how you can customise QNAM and friends.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

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

        The problem is that you have little or no control about how many bytes are actually transmitted "on the wire", considering f.i. gzip compression, chunked encoding, encryption, proxies, etc.

        If you're willing to patch Qt of course you have complete control on the underlying sockets, so you can get some counters from them.

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

        1 Reply Last reply
        0
        • A Offline
          A Offline
          A.A.M.
          wrote on last edited by
          #4

          ZapB, thanks, interesting blog. I'll try to apply a method described there.

          peppe, unfortunately a patching Qt isn't allowed. But that is a really powerful solution :)

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            ZapB
            wrote on last edited by
            #5

            You could also try using process accounting built into the OS. It depends exactly what you want to do.

            Nokia Certified Qt Specialist
            Interested in hearing about Qt related work

            1 Reply Last reply
            0
            • A Offline
              A Offline
              A.A.M.
              wrote on last edited by
              #6

              Just have QNetworkAccessManager and a couple of get/post requests. And want to have some connection info - count of rx/tx data.

              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