Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-15812

QNetworkAccessManager leaves the network connection open after HTTP request is finished

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 4.8.x
    • 4.7.0
    • None
    • Qt 4.7.0 for S^3. Tested on N8

      Underlying Symbian network interface is not closed after QNetworkRequest has finished. This is easy to notice because 3G connection icon stays active after the request. This is especially problematic on apps accessing network rarely. It leaves impression to end user that connection is active all the time.

      Probably connection shouldn't be closed immediately after the request because new request might follow quickly. But it seems that now the connection is never closed. Even after deleting both QNetworkRequest and QNetworkAccessManager objects connection seems to stay open.

      Problem is easy to reproduce with a following snippet:

      manager = new QNetworkAccessManager(this);
      request = new QNetworkRequest(QUrl("http://www.google.com"));
      connect(manager, SIGNAL(finished(QNetworkReply*)),
              this, SLOT(replyFinished(QNetworkReply*)));
      manager->get(*request);
      
      void replyFinished(QNetworkReply* reply)
      {
      reply->deleteLater();
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            shkearns Shane Kearns
            juhanak Juhana Koski
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: