Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8410747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:15:34+00:00 2026-06-10T00:15:34+00:00

When dealing with QNetworkReply , it is prescribed to use timers to abort the

  • 0

When dealing with QNetworkReply, it is prescribed to use timers to abort the connection.

Here is my current code:

void ImageDownloader::download(QString imgUrl){    
  this->timeoutTimer = new QTimer(this);
  this->timeoutTimer->setSingleShot(true);
  this->timeoutTimer->setInterval(15000);
  connect(this->timeoutTimer, SIGNAL(timeout()), this, SLOT(timeout()));

  QUrl requestUrl(imgUrl);
  QNetworkRequest nwRequest(requestUrl);
  this->imageNwReply = this->nam->get(nwRequest);
  connect(imageNwReply,SIGNAL(finished()),this,SLOT(imgDownloaded()));
  connect(imageNwReply, SIGNAL(downloadProgress(qint64,qint64)), this->timeoutTimer, SLOT(start()));
  this->timeoutTimer->start();
}

void ImageDownloader::timeout(){
  qDebug()<<__FUNCTION__<<" Forced timeout!";    
  this->imageNwReply->abort();
}

The confusion I am facing is when should I start the timer? At times I have to make around 50 concurrent Get requests from QNetworkAccessManager but since there is throttling for maximum concurrent connections, at times it happens that some of the requests get timed out even before they have been processed.

Is there a signal to know exactly when the processing for a request is started by QNeworkAccessManager so that I can start the corresponding timer only then?

One possible solution might be to implement a Queue of requests and have only the maximum possible connections to process but I am looking for a cleaner solution

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:15:35+00:00Added an answer on June 10, 2026 at 12:15 am

    There is an open bug/enhancement request for the issue. I got to know about this bug from Qt forum

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm dealing with memcpy to copy one array into another: here is the code,
Dealing with some legacy code and in trying to get a poorly designed database
When dealing with a series of numbers, and wanting to use hash results for
Other questions dealing with use of match_parent pre 2.2 have answers stating one should
I've been dealing with math-intensive code and require a good matrix library. I could
When dealing with streams of data, I prefer to write the code in terms
I'm dealing with a class which extends JFrame . It's not my code and
when dealing with mongodb, when should i use the {safe: true} on queries? Right
I'm dealing with an _NSDictionary that I'm trying to parse. I'm using this code
When dealing with a collection resource, I like to use the plural for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.