_Stefan
3rd March 2010, 13:59
Hello,
I am trying to make a HTTP get request, to a script that has a loop in it and posts data back at certain times.
For testing, in example, we made a little script, that returns some XML, as in, it gives use the XML header first, and every second after that, it will return a XML tag with some information we like. It does this 5 times, so it takes 5 seconds for the script to end, in this case.
For the real thing, the script will not end, or will be active for a longer period of time the least.
The problem is, when I use QNetworkAccessManager, it works fine doing the request and in the finished slot, I get my request data.
However, what it does, is, it waits the 5 seconds for the whole script to be executed. What I want is, that it first gives me some data, and then, every time some event when there is more data.
In fact, I would like to receive up to the XML header, and every time there is that delay of a second, a new event I have received data.
I guess it would be like a motion JPEG thing, where one would keep receiving the new JPEG data, just now, I want to receive XML tags.
I cannot find any setting, to get this to work, other than that I need to wait for the script to actually end.
The script works in Firefox, because it adds the XML tags every second until they are all there.
I hope I make any sense. Can anyone help me on this?
I am trying to make a HTTP get request, to a script that has a loop in it and posts data back at certain times.
For testing, in example, we made a little script, that returns some XML, as in, it gives use the XML header first, and every second after that, it will return a XML tag with some information we like. It does this 5 times, so it takes 5 seconds for the script to end, in this case.
For the real thing, the script will not end, or will be active for a longer period of time the least.
The problem is, when I use QNetworkAccessManager, it works fine doing the request and in the finished slot, I get my request data.
However, what it does, is, it waits the 5 seconds for the whole script to be executed. What I want is, that it first gives me some data, and then, every time some event when there is more data.
In fact, I would like to receive up to the XML header, and every time there is that delay of a second, a new event I have received data.
I guess it would be like a motion JPEG thing, where one would keep receiving the new JPEG data, just now, I want to receive XML tags.
I cannot find any setting, to get this to work, other than that I need to wait for the script to actually end.
The script works in Firefox, because it adds the XML tags every second until they are all there.
I hope I make any sense. Can anyone help me on this?