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



  • 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


Log in to reply
 

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