Question

Reviewing QNetworkAccessManager I don't see anything 'push' related. http://qt-project.org/doc/qt-5/qnetworkaccessmanager-members.html Unlike POST or GET, with 'push' http connection, you are maintaining the connection so you can receiving periodic updates from the server. What is the correct function to use for a HTTP REST 'push' client connection in Qt5? Or possibly a persistent http connection?

Was it helpful?

Solution

> How would I use QNetworkAccessManager to connect to an http push server?
*** Signoff: Raziel (Ping timeout: 265 seconds)
<thiago> pEYEd: what HTTP command do you need to send?
> thiago good point. I am not sure. It looks like json  https://www.cryptsy.com/pages/pushapi
*** sbw (~sbw@117.22.127.195) has joined channel #qt
<thiago> pEYEd: JSON is not an HTTP command
<thiago> try again: what HTTP command do you need to send?
> i know
*** Signoff: MagicHat (Quit: Leaving)
*** jankos (~js@203.215.119.190) has joined channel #qt
<thiago> pEYEd: let me try this: have you tried to simply get() the page?
*** TheCanadianBacon (~TheCanadi@CPEbc1401592013-CMbc1401592010.cpe.net.cable.rogers.com) has joined channel #qt
> it looks like POST
> http://pusher.com/docs/client_api_guide/client_connect
<thiago> then use post()
*** Signoff: nicolaf (Remote host closed the connection)
> thiago will it automatically do a persistant connection?
*** nicolaf (~nicola@static-217-133-54-77.clienti.tiscali.it) has joined channel #qt
<thiago> pEYEd: what exactly do you need to happen?
<thiago> it will keep giving you data as long as there's data to be given
> but it can't time out
*** Signoff: filipesaraiva (Read error: Connection reset by peer)
<thiago> once the data ends, the connection may be closed or reused. But you cannot and must not care about it.
<thiago> there's no timeout mechanism in QNAM
*** Hunts (~hunts@koln-4d0dd7cb.pool.mediaWays.net) has joined channel #qt
> no FIN/ACK unless specified?
<thiago> that's at a much lower level
<thiago> the HTTP request/reply ends when the server says it ends
> the connection can't close. no fin/ack
<thiago> under HTTP/1.1, it ends when the number of bytes specified in Content-Length is reached
*** Signoff: katmandoo (Ping timeout: 240 seconds)
<thiago> or the chunked encoding says it's the last chunk
<thiago> if either of those conditions happen, the QNetworkReply signals the end
<thiago> then QNAM can do whatever it wants to the socket
*** Signoff: saurabhsood91 (Remote host closed the connection)
> Thank you!
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top