Manager->get(....) is going into trans state and not coming back.
I am trying to donwload a xml file from server. I added below code..
QNetworkAccessManager *manager = new QNetworkAccessManager();
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(fileReplyFinished(QNetworkReply*))); manager->get(QNetworkRequest(QUrl::fromUserInput("http://my_website.com/my_file.xml")));
Some how I managed to build it sucessfully but when I am running the program, I can see after manager->get(.....) control is going to some where, not going to my SLOT function. I waited for long long time but still it is not coming back from that state.
It seems like it is waiting for Network response but I will get to know what is going wrong and most importantly why it is not going into my SLOT. I have read that get function does not wait but then where it is going wrong. I could not see any exception handling message also.
Did you also connect to other signals of your QNAM? They might be reporting that you need authentication, for instance. You could also, in line 7, use the returned QNetworkReply and check it for its status.
Also note that you seem to be wasting resources. Do you really need to create a new QNAM for every request you send? Who takes care of deleting this QNAM when its task is done?
Did you also connect to other signals of your QNAM?
NO, I don't have any other Signal in my program.
I added QNetworkReply to see the return value but call is not returning. It seems it gets stuck some where.
Please let me know what could be the reason.
I will delete QNAM at the end of the program. Let me know if there is any better way.
Take a hint then, and do connect the other signals to a slot so you get a better idea of what is going on.
With some changes now manager->get(....) is returning.....But response is always in running state. I ran it for more than 1 hour but it remain the same.
Do you have any idea why it is not going into finish state? BTW, I try to access the link through browser and it worked just fine.
Did you try the hint I gave you before?
I already gave you a hint. We can not help you debug your issue if you are not willing to take suggestions.