[Qt-interest] QTcpSocket Problem

Anthony Gabrielson agabrielson1 at comcast.net
Wed Jan 20 02:38:24 CET 2010


On Tue Tuesday, January 19, 2010 7:18 PM, Dan Mills wrote:

> Try either using the waitFor... methods in QTcpSocket (which don't need
> an event loop) which will work but will freeze the GUI until the
> download completes, or rewrite using a slot to handle the data when it
> becomes available. 

Hi Dan, 
	That was a good catch - I threw a waitForReadyRead(-1) at the top of the while loop in the client and it's still not behaving; it's actually hanging the client which is not a surprise.  For the time being I'm okay hanging the client, eventually I will move the sockets stuff to a thread I just want everything working before I do.

Here is the output I'm capturing from debugview, it still leads me to believe that the client is the issue:
[4940] putFile: filename   file.pdf Buf Size  256 
[4940] putFilev:type  9 8 
[4940] putFile: type  9  size  9 
[4940] putFile: sending  248  bytes 
... 
[4940] putFile: sending  248  bytes 
[4940] putFile: sending  93  bytes 
[4940] putFile: sending end data 
[4940] putFile: client child sent file  " phd.pdf" 
[3804] getFile: type  8  size  9 
[3804] getFile: filename  " file.pdf" 
[3804] getFile: recv  248  Bytes 
[3804] getFile: recv  248  Bytes 
[3804] getFile: recv  248  Bytes 
[3804] getFile: recv  248  Bytes

Do you have any other ideas by chance?

Thanks,
Anthony
	





More information about the Qt-interest-old mailing list