PDA

View Full Version : QThread, QFile and QTcpSocket freezes GUI



naresh
17th May 2006, 13:38
Hi! I have a problem with my app... It's an IM Client with p2p protocol for file transfering. The problem is that when i'm sending files gui totaly freezes... When i'm receiving files everything is fine (progress data is update with signals/slots). The code is available here: http://svn.berlios.de/svnroot/repos/qxygen/ and the file is src/filetransfer/filetransfer.cpp

Any help would be appreciated

//EDIT
Well de gui doesn't freeze but when i'm calling waitForBytesWritten it doesn't work as i suposed it to work. I tested it once more (Adding few small files not one big) And the gui was refreshing but results at "Server" and "Client" are different. i.e. sending (writing to socket) took 2 seconds at server (file 1810,6 kB) and client was receiving it 11 seconds :| How to make sure that client received data to socket?

jacek
24th June 2006, 00:25
sending (writing to socket) took 2 seconds at server (file 1810,6 kB) and client was receiving it 11 seconds
Most likely it was because of some buffering at OS level.


How to make sure that client received data to socket?
You will never know. ;) Unless it sends you an confirmation, but then again the client won't know if you got it, so you will have to send a confirmation of that confirmation, which brings you to the starting point.