jcon-cpp icon indicating copy to clipboard operation
jcon-cpp copied to clipboard

Track up-/downloadprogress when transmitting files

Open mbaldus opened this issue 5 years ago • 2 comments

Hi, I'm using your library for a Server-Client QT 5.13.1 C++ application. The framework uses TCP as underlying transport layer. Is there a way to track the current up-/downloadprogress of transmitted files? It would be useful for our users to see the progress, since the up-/download of large files takes a considerable amount of time.

I tried to use the QT functions QTcpSocket::bytesWritten , QTcpSocket::bytesAvailable etc. but they were not providing the correct numbers. The data is encoded as Base64 and stored in a QByteArray.

Do you have any suggestion to achieve the wanted feature?

Thank you for any reply. Best regards, Max B.

mbaldus avatar Jun 24 '20 12:06 mbaldus

Hi,

Is it maybe better to transfer the large files separate from the RPC system? You could then perhaps just return the URLs for the resources in the RPC responses, and then the client can grab the big file(s) from there? A quick Google led me to https://forum.qt.io/topic/77319/how-to-make-a-progress-bar-for-downloads/4 for instance.

joncol avatar Jun 25 '20 07:06 joncol

Hi, thats a nice idea and i will definitely give it a shot. I already work with QNetworkReply when the application is communicating with another REST-API. So i guess this might be working 👍 Thanks for the quick answer :)

mbaldus avatar Jun 25 '20 07:06 mbaldus