Results 1 to 4 of 4

Thread: QNetworkAccessManager - how to enable more than 6 connections

  1. #1
    Join Date
    Sep 2011
    Posts
    86
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default QNetworkAccessManager - how to enable more than 6 connections

    Hello, I'm trying to cooperate with very busy web server. I send get and post requests to it and wait few seconds for response. If there is no response I'm doing what I would do in a web browser - send request again. I think that this is an equivalent to refreshing page. But there is a problem. In HttpAnalyzerStdV7 I can see http requests and responds. It looks like QNetworkAccessManager let me sends only 6 requests at once and only when server responds after about 120 seconds with 504 - http timeout code I can send a new one. How can I abandon old request? I thought that deleting QNetworkReply would be enough but it doesn't work. Any suggestions?
    Last edited by code_err; 28th December 2015 at 12:17.

  2. #2
    Join Date
    Oct 2009
    Posts
    483
    Thanked 96 Times in 93 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkAccessManager - how to enable more than 6 connections

    Quote Originally Posted by code_err View Post
    It looks like QNetworkAccessManager let me sends only 6 requests at once and only when server responds after about 120 seconds with 504 - http timeout code I can send a new one.
    Indeed, as stated in the documentation for QNetworkAccessManager:
    Currently, for the HTTP protocol on desktop platforms, 6 requests are executed in parallel for one host/port combination.
    Quote Originally Posted by code_err View Post
    How can I abandon old request? I thought that deleting QNetworkReply would be enough but it doesn't work. Any suggestions?
    You could try QNetworkReply::abort(), but I suspect it will not improve over the destructor; both apparently close the network connection. Does your HttpAnalyzerStdV7 show the connections being closed?

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkAccessManager - how to enable more than 6 connections

    close and abort do different things, see the documentation for QNetworkReply::close().

    Cheers,
    _

  4. #4
    Join Date
    Sep 2011
    Posts
    86
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QNetworkAccessManager - how to enable more than 6 connections

    Thank You. I didn't see abort and close. It can be useful. HttpAnalyzerStdV7 shows only requests and responds. After 120s server responds with 504 code and then connection is shown by HttpAnalyzerStdV7 as closed.

Similar Threads

  1. Replies: 8
    Last Post: 8th July 2013, 09:51
  2. How to use QNetworkAccesManager ??
    By sliverTwist in forum Newbie
    Replies: 3
    Last Post: 30th March 2013, 07:00
  3. disable enable network connections?
    By remy06 in forum Qt Programming
    Replies: 2
    Last Post: 8th May 2009, 18:52
  4. DLL Connections
    By TheGrimace in forum Qt Programming
    Replies: 1
    Last Post: 20th June 2007, 16:39
  5. # of connections?
    By gfunk in forum Qt Programming
    Replies: 1
    Last Post: 3rd August 2006, 00:31

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.