PDA

View Full Version : QNetworkAccessManager timeout/abort



codeslicer
11th July 2010, 03:26
I've been having this issue for a firewall. My application makes a request through QNetworkAccessManager (or QHttp/QFtp) that sometimes cannot be completed. This can happen for several reasons:

Firewall is "freezing" the socket
Server is down or lagging
There is some network problem

My application is aimed to act as a daemon that continuously downloads and uploads data, so when the connection hangs, essentially the application stops performing its tasks. To resolve this problem I need to create a timeout, as there isn't one implemented by default. Here I run into issues though, as there doesn't seem to be a way of aborting a socket for Network Reply. For example this ends up crashing:

QNetworkReply *httpReply;
httpReply = myNetworkAccessManager->get(request)
...
httpReply->abort();
So, anyone have any ideas on how to resolve this?

Thanks in advance.

rbp
20th September 2010, 02:18
hello,
did you make any progress? I am also facing this problem.

frankiefrank
16th May 2011, 14:20
You say you have crashes? Can you say exactly what the error is?

Is there a chance you're deleting your replies in some other point which makes your abort call crash?