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. How to increase Time Out when send request to and get reply from web with proxy using QNetworkAccessManager class
Forum Updated to NodeBB v4.3 + New Features

How to increase Time Out when send request to and get reply from web with proxy using QNetworkAccessManager class

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.0k Views 1 Watching
  • 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.
  • Z Offline
    Z Offline
    Zain
    wrote on last edited by
    #1

    Hello All,

    I am developing an application in which i need to get no of backlinks of multiple sites with different proxies.
    I am using below code in loop to set proxy and send request to and get reply from web.

    Code using to set proxy : @ QNetworkProxy proxy;
    proxy.hostName="something"
    proxy.port="something"
    QNetworkProxy::setApplicationProxy(proxy);@

    code of QNetworkAccessManager class and connect function with signal and slot:

    @QNetworkAccessManager *qnam123 = new QNetworkAccessManager(this);
    QNetworkRequest request123;
    request123.setUrl(QUrl(siteUrl));
    qnam123->get(QNetworkRequest(request123));
    QNetworkReply *reply123 = qnam123->get(request123);
    connect(reply123, SIGNAL(finished()), this, SLOT(getBackLinksReply()));@

    When I am running above code in loop multiple times with different proxy each time in reply i am getting following result.

    "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>301 Moved Permanently</title></head><body><h1>Moved Permanently</h1><p>The document has moved <a href="http://www.majesticseo.com/reports/site-explorer/summary/google.com?IndexDataSource=F">here</a>.</p></body></html>"

    While I tried same above url with proxies directly via browser it is working fine but taking some time to open .

    I guess when i am sending request and getting reply using connect function from my code due to connection Time Out,I am getting above reply.

    Please correct me if i am wrong and suggest me how can i increase Time Out.
    Any suggestion appreciated (better if code is included :) )

    Thanks in advance
    Zain

    1 Reply Last reply
    0

    • Login

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