QNetworkManager periodically stops the tcp communication

  • 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?

  • Moderators

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

  • 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?

  • 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;

    Moved to thread

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.