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. QNetworkManager periodically stops the tcp communication

QNetworkManager periodically stops the tcp communication

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 774 Views
  • 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.
  • P Offline
    P Offline
    purcola
    wrote on last edited by
    #1

    I am creating a program with two different flows of data: one tcp wireless connection receiving about 24 kB/s, with a home made socket interface implementation, and eventually some http requests (also wireless), with the QNetworkManager class.
    I realized that it works like a charm if I only have the tcp connection. But, as soon as I instantiate the network manager class, then every 10 seconds the tcp communication is interrupted for 1 second. This happens even if I don't create any http request. See the picture of a capture of the network using wireshark to see the behaviour. Is there anything in this class that periodically causes this effect?

    jsulmJ 1 Reply Last reply
    0
    • P Offline
      P Offline
      purcola
      wrote on last edited by
      #4

      Looks like there is a internal slot in the QNetworkAccessManager that blocks the network access every 10 seconds.
      I have tried moving the class to another thread and it works as expected.

       QNetworkAccessManager qnam;
       QThread thread;
       qnam.moveToThread(&thread);
       thread.start();
      

      Moved to thread

      1 Reply Last reply
      1
      • P purcola

        I am creating a program with two different flows of data: one tcp wireless connection receiving about 24 kB/s, with a home made socket interface implementation, and eventually some http requests (also wireless), with the QNetworkManager class.
        I realized that it works like a charm if I only have the tcp connection. But, as soon as I instantiate the network manager class, then every 10 seconds the tcp communication is interrupted for 1 second. This happens even if I don't create any http request. See the picture of a capture of the network using wireshark to see the behaviour. Is there anything in this class that periodically causes this effect?

        jsulmJ Online
        jsulmJ Online
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @purcola I you sure it's not something in your app? I don't think there is anything in QNetworkManager periodically stopping network communication.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • P Offline
          P Offline
          purcola
          wrote on last edited by
          #3

          Could be. But I have tried with different applications and the behaviour is the same.
          I did a test in a UDP streaming application over the very same wireless network. The only line I added to the code is the following:

          QNetworkAccessManager manager;
          

          The results are the same: Every 10 seconds there is something going on in the network.
          Without the QNetworkAccessManager and With the QNetworkAccessManager

          Any clues?

          1 Reply Last reply
          0
          • P Offline
            P Offline
            purcola
            wrote on last edited by
            #4

            Looks like there is a internal slot in the QNetworkAccessManager that blocks the network access every 10 seconds.
            I have tried moving the class to another thread and it works as expected.

             QNetworkAccessManager qnam;
             QThread thread;
             qnam.moveToThread(&thread);
             thread.start();
            

            Moved to thread

            1 Reply Last reply
            1

            • Login

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