PDA

View Full Version : Downloading files simultanously without making program stop responfing (Threads?)



kremuwa
16th April 2010, 23:02
Hello there,

I'm working on P2M client. The program has to be able to download many files simultanously. I have made a program using QTcpSocket class, which is logging in to the mailbox and downloading all the attachments which are there. The problem is, that the application is completely not responding during the process of downloading.

Why something like that happens, how to deal with it?
What if I want to log in to, let's say, 9 mailboxes simultanously and download the attachments from there at the same time? And keep the app working, of course.

Every help will be appreciated :).

Jarvis
17th April 2010, 00:12
Hi,

Yes, such behaviour is normal. You have to manage each connection into one thread.
Once a thread is launched, its background work is started and the main thread continues its flow.